@@ -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 ] ) ;
@@ -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
@@ -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 ) {
@@ -1106,7 +1092,7 @@ gulp.task("lint", "Runs tslint on the compiler sources. Optional arguments are:
1106
1092
const fileMatcher = cmdLineOptions . files ;
1107
1093
const files = fileMatcher
1108
1094
? `src/**/${ fileMatcher } `
1109
- : "Gulpfile.ts 'scripts/generateLocalizedDiagnosticMessages.ts' 'scripts/tslint/**/*.ts' 'src/**/*.ts' --exclude src/lib/es5.d.ts --exclude 'src/lib/*.generated .d.ts'" ;
1095
+ : "Gulpfile.ts 'scripts/generateLocalizedDiagnosticMessages.ts' 'scripts/tslint/**/*.ts' 'src/**/*.ts' --exclude 'src/lib/*.d.ts'" ;
1110
1096
const cmd = `node node_modules/tslint/bin/tslint ${ files } --formatters-dir ./built/local/tslint/formatters --format autolinkableStylish` ;
1111
1097
console . log ( "Linting: " + cmd ) ;
1112
1098
child_process . execSync ( cmd , { stdio : [ 0 , 1 , 2 ] } ) ;
0 commit comments