@@ -76,6 +76,10 @@ function measure(marker) {
76
76
console . log ( "travis_time:end:" + marker . id + ":start=" + toNs ( marker . stamp ) + ",finish=" + toNs ( total ) + ",duration=" + toNs ( diff ) + "\r" ) ;
77
77
}
78
78
79
+ function removeConstModifierFromEnumDeclarations ( text ) {
80
+ return text . replace ( / ^ ( \s * ) ( e x p o r t ) ? c o n s t e n u m ( \S + ) { ( \s * ) $ / gm, '$1$2enum $3 {$4' ) ;
81
+ }
82
+
79
83
var compilerSources = filesFromConfig ( "./src/compiler/tsconfig.json" ) ;
80
84
var servicesSources = filesFromConfig ( "./src/services/tsconfig.json" ) ;
81
85
var cancellationTokenSources = filesFromConfig ( path . join ( serverDirectory , "cancellationToken/tsconfig.json" ) ) ;
@@ -553,7 +557,7 @@ compileFile(servicesFile, servicesSources, [builtLocalDirectory, copyright].conc
553
557
// Stanalone/web definition file using global 'ts' namespace
554
558
jake . cpR ( standaloneDefinitionsFile , nodeDefinitionsFile , { silent : true } ) ;
555
559
var definitionFileContents = fs . readFileSync ( nodeDefinitionsFile ) . toString ( ) ;
556
- definitionFileContents = definitionFileContents . replace ( / ^ ( \s * ) ( e x p o r t ) ? c o n s t e n u m ( \S + ) { ( \s * ) $ / gm , '$1$2enum $3 {$4' ) ;
560
+ definitionFileContents = removeConstModifierFromEnumDeclarations ( definitionFileContents )
557
561
fs . writeFileSync ( standaloneDefinitionsFile , definitionFileContents ) ;
558
562
559
563
// Official node package definition file, pointed to by 'typings' in package.json
@@ -613,6 +617,7 @@ compileFile(
613
617
fs . readFileSync ( tsserverLibraryDefinitionFile ) . toString ( ) +
614
618
"\r\nexport = ts;" +
615
619
"\r\nexport as namespace ts;" ;
620
+ tsserverLibraryDefinitionFileContents = removeConstModifierFromEnumDeclarations ( tsserverLibraryDefinitionFileContents ) ;
616
621
617
622
fs . writeFileSync ( tsserverLibraryDefinitionFile , tsserverLibraryDefinitionFileContents ) ;
618
623
} ) ;
0 commit comments