@@ -99,12 +99,12 @@ const lclDirectory = "src/loc/lcl";
99
99
100
100
const builtDirectory = "built/" ;
101
101
const builtLocalDirectory = "built/local/" ;
102
- const LKGDirectory = "lib/" ;
102
+ const lkgDirectory = "lib/" ;
103
103
104
104
const copyright = "CopyrightNotice.txt" ;
105
105
106
106
const compilerFilename = "tsc.js" ;
107
- const LKGCompiler = path . join ( LKGDirectory , compilerFilename ) ;
107
+ const lkgCompiler = path . join ( lkgDirectory , compilerFilename ) ;
108
108
const builtLocalCompiler = path . join ( builtLocalDirectory , compilerFilename ) ;
109
109
110
110
const nodeModulesPathPrefix = path . resolve ( "./node_modules/.bin/" ) ;
@@ -123,15 +123,13 @@ const es2015LibrarySources = [
123
123
"es2015.symbol.wellknown.d.ts"
124
124
] ;
125
125
126
- const es2015LibrarySourceMap = es2015LibrarySources . map ( function ( source ) {
127
- return { target : "lib." + source , sources : [ "header.d.ts" , source ] } ;
128
- } ) ;
126
+ const es2015LibrarySourceMap = es2015LibrarySources . map ( source =>
127
+ ( { target : "lib." + source , sources : [ "header.d.ts" , source ] } ) ) ;
129
128
130
129
const es2016LibrarySource = [ "es2016.array.include.d.ts" ] ;
131
130
132
- const es2016LibrarySourceMap = es2016LibrarySource . map ( function ( source ) {
133
- return { target : "lib." + source , sources : [ "header.d.ts" , source ] } ;
134
- } ) ;
131
+ const es2016LibrarySourceMap = es2016LibrarySource . map ( source =>
132
+ ( { target : "lib." + source , sources : [ "header.d.ts" , source ] } ) ) ;
135
133
136
134
const es2017LibrarySource = [
137
135
"es2017.object.d.ts" ,
@@ -140,17 +138,15 @@ const es2017LibrarySource = [
140
138
"es2017.intl.d.ts" ,
141
139
] ;
142
140
143
- const es2017LibrarySourceMap = es2017LibrarySource . map ( function ( source ) {
144
- return { target : "lib." + source , sources : [ "header.d.ts" , source ] } ;
145
- } ) ;
141
+ const es2017LibrarySourceMap = es2017LibrarySource . map ( source =>
142
+ ( { target : "lib." + source , sources : [ "header.d.ts" , source ] } ) ) ;
146
143
147
144
const esnextLibrarySource = [
148
145
"esnext.asynciterable.d.ts"
149
146
] ;
150
147
151
- const esnextLibrarySourceMap = esnextLibrarySource . map ( function ( source ) {
152
- return { target : "lib." + source , sources : [ "header.d.ts" , source ] } ;
153
- } ) ;
148
+ const esnextLibrarySourceMap = esnextLibrarySource . map ( source =>
149
+ ( { target : "lib." + source , sources : [ "header.d.ts" , source ] } ) ) ;
154
150
155
151
const hostsLibrarySources = [ "dom.generated.d.ts" , "webworker.importscripts.d.ts" , "scripthost.d.ts" ] ;
156
152
@@ -176,9 +172,8 @@ const librarySourceMap = [
176
172
{ target : "lib.esnext.full.d.ts" , sources : [ "header.d.ts" , "esnext.d.ts" ] . concat ( hostsLibrarySources , "dom.iterable.d.ts" ) } ,
177
173
] . concat ( es2015LibrarySourceMap , es2016LibrarySourceMap , es2017LibrarySourceMap , esnextLibrarySourceMap ) ;
178
174
179
- const libraryTargets = librarySourceMap . map ( function ( f ) {
180
- return path . join ( builtLocalDirectory , f . target ) ;
181
- } ) ;
175
+ const libraryTargets = librarySourceMap . map ( f =>
176
+ path . join ( builtLocalDirectory , f . target ) ) ;
182
177
183
178
/**
184
179
* .lcg file is what localization team uses to know what messages to localize.
@@ -193,22 +188,19 @@ const generatedLCGFile = path.join(builtLocalDirectory, "enu", "diagnosticMessag
193
188
* 2. 'src\compiler\diagnosticMessages.generated.json' => 'built\local\ENU\diagnosticMessages.generated.json.lcg'
194
189
* generate the lcg file (source of messages to localize) from the diagnosticMessages.generated.json
195
190
*/
196
- const localizationTargets = [ "cs" , "de" , "es" , "fr" , "it" , "ja" , "ko" , "pl" , "pt-BR" , "ru" , "tr" , "zh-CN" , "zh-TW" ] . map ( function ( f ) {
197
- return path . join ( builtLocalDirectory , f , "diagnosticMessages.generated.json" ) ;
198
- } ) . concat ( generatedLCGFile ) ;
191
+ const localizationTargets = [ "cs" , "de" , "es" , "fr" , "it" , "ja" , "ko" , "pl" , "pt-BR" , "ru" , "tr" , "zh-CN" , "zh-TW" ]
192
+ . map ( f => path . join ( builtLocalDirectory , f , "diagnosticMessages.generated.json" ) )
193
+ . concat ( generatedLCGFile ) ;
199
194
200
195
for ( const i in libraryTargets ) {
201
196
const entry = librarySourceMap [ i ] ;
202
197
const target = libraryTargets [ i ] ;
203
- const sources = [ copyright ] . concat ( entry . sources . map ( function ( s ) {
204
- return path . join ( libraryDirectory , s ) ;
205
- } ) ) ;
206
- gulp . task ( target , /*help*/ false , [ ] , function ( ) {
207
- return gulp . src ( sources )
198
+ const sources = [ copyright ] . concat ( entry . sources . map ( s => path . join ( libraryDirectory , s ) ) ) ;
199
+ gulp . task ( target , /*help*/ false , [ ] , ( ) =>
200
+ gulp . src ( sources )
208
201
. pipe ( newer ( target ) )
209
202
. pipe ( concat ( target , { newLine : "\n\n" } ) )
210
- . pipe ( gulp . dest ( "." ) ) ;
211
- } ) ;
203
+ . pipe ( gulp . dest ( "." ) ) ) ;
212
204
}
213
205
214
206
const configureNightlyJs = path . join ( scriptsDirectory , "configureNightly.js" ) ;
@@ -575,9 +567,7 @@ gulp.task(specMd, /*help*/ false, [word2mdJs], (done) => {
575
567
const specMDFullPath = path . resolve ( specMd ) ;
576
568
const cmd = "cscript //nologo " + word2mdJs + " \"" + specWordFullPath + "\" " + "\"" + specMDFullPath + "\"" ;
577
569
console . log ( cmd ) ;
578
- cp . exec ( cmd , function ( ) {
579
- done ( ) ;
580
- } ) ;
570
+ cp . exec ( cmd , done ) ;
581
571
} ) ;
582
572
583
573
gulp . task ( "generate-spec" , "Generates a Markdown version of the Language Specification" , [ specMd ] ) ;
@@ -599,7 +589,7 @@ gulp.task("VerifyLKG", /*help*/ false, [], () => {
599
589
". The following files are missing:\n" + missingFiles . join ( "\n" ) ) ;
600
590
}
601
591
// Copy all the targets into the LKG directory
602
- return gulp . src ( [ ...expectedFiles , path . join ( builtLocalDirectory , "**" ) , `!${ path . join ( builtLocalDirectory , "tslint" ) } ` , `!${ path . join ( builtLocalDirectory , "*.*" ) } ` ] ) . pipe ( gulp . dest ( LKGDirectory ) ) ;
592
+ return gulp . src ( [ ...expectedFiles , path . join ( builtLocalDirectory , "**" ) , `!${ path . join ( builtLocalDirectory , "tslint" ) } ` , `!${ path . join ( builtLocalDirectory , "*.*" ) } ` ] ) . pipe ( gulp . dest ( lkgDirectory ) ) ;
603
593
} ) ;
604
594
605
595
gulp . task ( "LKGInternal" , /*help*/ false , [ "lib" , "local" ] ) ;
@@ -714,17 +704,13 @@ function runConsoleTests(defaultReporter: string, runInParallel: boolean, done:
714
704
}
715
705
args . push ( run ) ;
716
706
setNodeEnvToDevelopment ( ) ;
717
- exec ( mocha , args , lintThenFinish , function ( e , status ) {
718
- finish ( e , status ) ;
719
- } ) ;
707
+ exec ( mocha , args , lintThenFinish , finish ) ;
720
708
721
709
}
722
710
else {
723
711
// run task to load all tests and partition them between workers
724
712
setNodeEnvToDevelopment ( ) ;
725
- exec ( host , [ run ] , lintThenFinish , function ( e , status ) {
726
- finish ( e , status ) ;
727
- } ) ;
713
+ exec ( host , [ run ] , lintThenFinish , finish ) ;
728
714
}
729
715
} ) ;
730
716
@@ -1006,7 +992,7 @@ gulp.task(loggedIOJsPath, /*help*/ false, [], (done) => {
1006
992
const temp = path . join ( builtLocalDirectory , "temp" ) ;
1007
993
mkdirP ( temp , ( err ) => {
1008
994
if ( err ) { console . error ( err ) ; done ( err ) ; process . exit ( 1 ) ; }
1009
- exec ( host , [ LKGCompiler , "--types" , "--target es5" , "--lib es5" , "--outdir" , temp , loggedIOpath ] , ( ) => {
995
+ exec ( host , [ lkgCompiler , "--types" , "--target es5" , "--lib es5" , "--outdir" , temp , loggedIOpath ] , ( ) => {
1010
996
fs . renameSync ( path . join ( temp , "/harness/loggedIO.js" ) , loggedIOJsPath ) ;
1011
997
del ( temp ) . then ( ( ) => done ( ) , done ) ;
1012
998
} , done ) ;
@@ -1082,7 +1068,7 @@ function sendNextFile(files: {path: string}[], child: cp.ChildProcess, callback:
1082
1068
function spawnLintWorker ( files : { path : string } [ ] , callback : ( failures : number ) => void ) {
1083
1069
const child = cp . fork ( "./scripts/parallel-lint" ) ;
1084
1070
let failures = 0 ;
1085
- child . on ( "message" , function ( data ) {
1071
+ child . on ( "message" , data => {
1086
1072
switch ( data . kind ) {
1087
1073
case "result" :
1088
1074
if ( data . failures > 0 ) {
0 commit comments