File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ namespace FourSlash {
130130 // 0 - cancelled
131131 // >0 - not cancelled
132132 // <0 - not cancelled and value denotes number of isCancellationRequested after which token become cancelled
133- private static NotCanceled : number = - 1 ;
133+ private static readonly NotCanceled : number = - 1 ;
134134 private numberOfCallsBeforeCancellation : number = TestCancellationToken . NotCanceled ;
135135
136136 public isCancellationRequested ( ) : boolean {
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ namespace Harness.LanguageService {
108108 }
109109
110110 class DefaultHostCancellationToken implements ts . HostCancellationToken {
111- public static Instance = new DefaultHostCancellationToken ( ) ;
111+ public static readonly Instance = new DefaultHostCancellationToken ( ) ;
112112
113113 public isCancellationRequested ( ) {
114114 return false ;
Original file line number Diff line number Diff line change @@ -238,10 +238,8 @@ namespace RWC {
238238}
239239
240240class RWCRunner extends RunnerBase {
241- private static sourcePath = "internal/cases/rwc/" ;
242-
243241 public enumerateTestFiles ( ) {
244- return Harness . IO . listFiles ( RWCRunner . sourcePath , / .+ \. j s o n $ / ) ;
242+ return Harness . IO . listFiles ( "internal/cases/rwc/" , / .+ \. j s o n $ / ) ;
245243 }
246244
247245 public kind ( ) : TestRunnerKind {
Original file line number Diff line number Diff line change 44/* tslint:disable:no-null-keyword */
55
66class Test262BaselineRunner extends RunnerBase {
7- private static basePath = "internal/cases/test262" ;
8- private static helpersFilePath = "tests/cases/test262-harness/helpers.d.ts" ;
9- private static helperFile : Harness . Compiler . TestFile = {
7+ private static readonly basePath = "internal/cases/test262" ;
8+ private static readonly helpersFilePath = "tests/cases/test262-harness/helpers.d.ts" ;
9+ private static readonly helperFile : Harness . Compiler . TestFile = {
1010 unitName : Test262BaselineRunner . helpersFilePath ,
1111 content : Harness . IO . readFile ( Test262BaselineRunner . helpersFilePath ) ,
1212 } ;
13- private static testFileExtensionRegex = / \. j s $ / ;
14- private static options : ts . CompilerOptions = {
13+ private static readonly testFileExtensionRegex = / \. j s $ / ;
14+ private static readonly options : ts . CompilerOptions = {
1515 allowNonTsExtensions : true ,
1616 target : ts . ScriptTarget . Latest ,
1717 module : ts . ModuleKind . CommonJS
1818 } ;
19- private static baselineOptions : Harness . Baseline . BaselineOptions = {
19+ private static readonly baselineOptions : Harness . Baseline . BaselineOptions = {
2020 Subfolder : "test262" ,
2121 Baselinefolder : "internal/baselines"
2222 } ;
Original file line number Diff line number Diff line change @@ -1614,7 +1614,7 @@ namespace ts.server {
16141614 }
16151615
16161616 /** Makes a filename safe to insert in a RegExp */
1617- private static filenameEscapeRegexp = / [ - \/ \\ ^ $ * + ? . ( ) | [ \] { } ] / g;
1617+ private static readonly filenameEscapeRegexp = / [ - \/ \\ ^ $ * + ? . ( ) | [ \] { } ] / g;
16181618 private static escapeFilenameForRegex ( filename : string ) {
16191619 return filename . replace ( this . filenameEscapeRegexp , "\\$&" ) ;
16201620 }
Original file line number Diff line number Diff line change @@ -837,7 +837,7 @@ namespace ts.server {
837837 */
838838 export class InferredProject extends Project {
839839
840- private static newName = ( ( ) => {
840+ private static readonly newName = ( ( ) => {
841841 let nextId = 1 ;
842842 return ( ) => {
843843 const id = nextId ;
Original file line number Diff line number Diff line change 44namespace ts . formatting {
55
66 export class RuleOperationContext {
7- private customContextChecks : { ( context : FormattingContext ) : boolean ; } [ ] ;
7+ private readonly customContextChecks : { ( context : FormattingContext ) : boolean ; } [ ] ;
88
99 constructor ( ...funcs : { ( context : FormattingContext ) : boolean ; } [ ] ) {
1010 this . customContextChecks = funcs ;
1111 }
1212
13- static Any : RuleOperationContext = new RuleOperationContext ( ) ;
13+ static readonly Any : RuleOperationContext = new RuleOperationContext ( ) ;
1414
1515 public IsAny ( ) : boolean {
1616 return this === RuleOperationContext . Any ;
You can’t perform that action at this time.
0 commit comments