@@ -76,6 +76,10 @@ function measure(marker) {
7676 console . log ( "travis_time:end:" + marker . id + ":start=" + toNs ( marker . stamp ) + ",finish=" + toNs ( total ) + ",duration=" + toNs ( diff ) + "\r" ) ;
7777}
7878
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+
7983var compilerSources = filesFromConfig ( "./src/compiler/tsconfig.json" ) ;
8084var servicesSources = filesFromConfig ( "./src/services/tsconfig.json" ) ;
8185var cancellationTokenSources = filesFromConfig ( path . join ( serverDirectory , "cancellationToken/tsconfig.json" ) ) ;
@@ -553,7 +557,7 @@ compileFile(servicesFile, servicesSources, [builtLocalDirectory, copyright].conc
553557 // Stanalone/web definition file using global 'ts' namespace
554558 jake . cpR ( standaloneDefinitionsFile , nodeDefinitionsFile , { silent : true } ) ;
555559 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 )
557561 fs . writeFileSync ( standaloneDefinitionsFile , definitionFileContents ) ;
558562
559563 // Official node package definition file, pointed to by 'typings' in package.json
@@ -613,6 +617,7 @@ compileFile(
613617 fs . readFileSync ( tsserverLibraryDefinitionFile ) . toString ( ) +
614618 "\r\nexport = ts;" +
615619 "\r\nexport as namespace ts;" ;
620+ tsserverLibraryDefinitionFileContents = removeConstModifierFromEnumDeclarations ( tsserverLibraryDefinitionFileContents ) ;
616621
617622 fs . writeFileSync ( tsserverLibraryDefinitionFile , tsserverLibraryDefinitionFileContents ) ;
618623 } ) ;
0 commit comments