Skip to content

Commit c2374c4

Browse files
committed
Merge branch 'master' into 6229-known-length-tuples
2 parents 2399d58 + b5f4a83 commit c2374c4

File tree

132 files changed

+2297
-822
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+2297
-822
lines changed

Gulpfile.ts

Lines changed: 25 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ const lclDirectory = "src/loc/lcl";
9999

100100
const builtDirectory = "built/";
101101
const builtLocalDirectory = "built/local/";
102-
const LKGDirectory = "lib/";
102+
const lkgDirectory = "lib/";
103103

104104
const copyright = "CopyrightNotice.txt";
105105

106106
const compilerFilename = "tsc.js";
107-
const LKGCompiler = path.join(LKGDirectory, compilerFilename);
107+
const lkgCompiler = path.join(lkgDirectory, compilerFilename);
108108
const builtLocalCompiler = path.join(builtLocalDirectory, compilerFilename);
109109

110110
const nodeModulesPathPrefix = path.resolve("./node_modules/.bin/");
@@ -123,15 +123,13 @@ const es2015LibrarySources = [
123123
"es2015.symbol.wellknown.d.ts"
124124
];
125125

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] }));
129128

130129
const es2016LibrarySource = ["es2016.array.include.d.ts"];
131130

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] }));
135133

136134
const es2017LibrarySource = [
137135
"es2017.object.d.ts",
@@ -140,17 +138,15 @@ const es2017LibrarySource = [
140138
"es2017.intl.d.ts",
141139
];
142140

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] }));
146143

147144
const esnextLibrarySource = [
148145
"esnext.asynciterable.d.ts"
149146
];
150147

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] }));
154150

155151
const hostsLibrarySources = ["dom.generated.d.ts", "webworker.importscripts.d.ts", "scripthost.d.ts"];
156152

@@ -176,9 +172,8 @@ const librarySourceMap = [
176172
{ target: "lib.esnext.full.d.ts", sources: ["header.d.ts", "esnext.d.ts"].concat(hostsLibrarySources, "dom.iterable.d.ts") },
177173
].concat(es2015LibrarySourceMap, es2016LibrarySourceMap, es2017LibrarySourceMap, esnextLibrarySourceMap);
178174

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));
182177

183178
/**
184179
* .lcg file is what localization team uses to know what messages to localize.
@@ -193,22 +188,19 @@ const generatedLCGFile = path.join(builtLocalDirectory, "enu", "diagnosticMessag
193188
* 2. 'src\compiler\diagnosticMessages.generated.json' => 'built\local\ENU\diagnosticMessages.generated.json.lcg'
194189
* generate the lcg file (source of messages to localize) from the diagnosticMessages.generated.json
195190
*/
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);
199194

200195
for (const i in libraryTargets) {
201196
const entry = librarySourceMap[i];
202197
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)
208201
.pipe(newer(target))
209202
.pipe(concat(target, { newLine: "\n\n" }))
210-
.pipe(gulp.dest("."));
211-
});
203+
.pipe(gulp.dest(".")));
212204
}
213205

214206
const configureNightlyJs = path.join(scriptsDirectory, "configureNightly.js");
@@ -575,9 +567,7 @@ gulp.task(specMd, /*help*/ false, [word2mdJs], (done) => {
575567
const specMDFullPath = path.resolve(specMd);
576568
const cmd = "cscript //nologo " + word2mdJs + " \"" + specWordFullPath + "\" " + "\"" + specMDFullPath + "\"";
577569
console.log(cmd);
578-
cp.exec(cmd, function() {
579-
done();
580-
});
570+
cp.exec(cmd, done);
581571
});
582572

583573
gulp.task("generate-spec", "Generates a Markdown version of the Language Specification", [specMd]);
@@ -599,7 +589,7 @@ gulp.task("VerifyLKG", /*help*/ false, [], () => {
599589
". The following files are missing:\n" + missingFiles.join("\n"));
600590
}
601591
// 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));
603593
});
604594

605595
gulp.task("LKGInternal", /*help*/ false, ["lib", "local"]);
@@ -714,17 +704,13 @@ function runConsoleTests(defaultReporter: string, runInParallel: boolean, done:
714704
}
715705
args.push(run);
716706
setNodeEnvToDevelopment();
717-
exec(mocha, args, lintThenFinish, function(e, status) {
718-
finish(e, status);
719-
});
707+
exec(mocha, args, lintThenFinish, finish);
720708

721709
}
722710
else {
723711
// run task to load all tests and partition them between workers
724712
setNodeEnvToDevelopment();
725-
exec(host, [run], lintThenFinish, function(e, status) {
726-
finish(e, status);
727-
});
713+
exec(host, [run], lintThenFinish, finish);
728714
}
729715
});
730716

@@ -1006,7 +992,7 @@ gulp.task(loggedIOJsPath, /*help*/ false, [], (done) => {
1006992
const temp = path.join(builtLocalDirectory, "temp");
1007993
mkdirP(temp, (err) => {
1008994
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], () => {
1010996
fs.renameSync(path.join(temp, "/harness/loggedIO.js"), loggedIOJsPath);
1011997
del(temp).then(() => done(), done);
1012998
}, done);
@@ -1082,7 +1068,7 @@ function sendNextFile(files: {path: string}[], child: cp.ChildProcess, callback:
10821068
function spawnLintWorker(files: {path: string}[], callback: (failures: number) => void) {
10831069
const child = cp.fork("./scripts/parallel-lint");
10841070
let failures = 0;
1085-
child.on("message", function(data) {
1071+
child.on("message", data => {
10861072
switch (data.kind) {
10871073
case "result":
10881074
if (data.failures > 0) {

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,12 @@
7474
"q": "latest",
7575
"run-sequence": "latest",
7676
"sorcery": "latest",
77+
"source-map-support": "latest",
7778
"through2": "latest",
7879
"travis-fold": "latest",
7980
"ts-node": "latest",
8081
"tslint": "latest",
82+
"vinyl": "latest",
8183
"colors": "latest",
8284
"typescript": "next"
8385
},

scripts/generateLocalizedDiagnosticMessages.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ function main(): void {
8787
const out: any = {};
8888
for (const item of o.LCX.Item[0].Item[0].Item) {
8989
let ItemId = item.$.ItemId;
90-
let Val = item.Str[0].Tgt ? item.Str[0].Tgt[0].Val[0] : item.Str[0].Val[0];
90+
let val = item.Str[0].Tgt ? item.Str[0].Tgt[0].Val[0] : item.Str[0].Val[0];
9191

92-
if (typeof ItemId !== "string" || typeof Val !== "string") {
92+
if (typeof ItemId !== "string" || typeof val !== "string") {
9393
console.error("Unexpected XML file structure");
9494
process.exit(1);
9595
}
@@ -98,8 +98,8 @@ function main(): void {
9898
ItemId = ItemId.slice(1); // remove leading semicolon
9999
}
100100

101-
Val = Val.replace(/]5D;/, "]"); // unescape `]`
102-
out[ItemId] = Val;
101+
val = val.replace(/]5D;/, "]"); // unescape `]`
102+
out[ItemId] = val;
103103
}
104104
return JSON.stringify(out, undefined, 2);
105105
}

scripts/processDiagnosticMessages.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ function buildInfoFileOutput(messageTable: InputDiagnosticMessageTable): string
6363
" function diag(code: number, category: DiagnosticCategory, key: string, message: string): DiagnosticMessage {\r\n" +
6464
" return { code, category, key, message };\r\n" +
6565
" }\r\n" +
66-
' export const Diagnostics = {\r\n';
66+
" // tslint:disable-next-line variable-name\r\n" +
67+
" export const Diagnostics = {\r\n";
6768
messageTable.forEach(({ code, category }, name) => {
6869
const propName = convertPropertyName(name);
6970
result += ` ${propName}: diag(${code}, DiagnosticCategory.${category}, "${createKey(propName, code)}", ${JSON.stringify(name)}),\r\n`;

src/compiler/binder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ namespace ts {
133133

134134
let symbolCount = 0;
135135

136-
let Symbol: { new (flags: SymbolFlags, name: __String): Symbol };
136+
let Symbol: { new (flags: SymbolFlags, name: __String): Symbol }; // tslint:disable-line variable-name
137137
let classifiableNames: UnderscoreEscapedMap<true>;
138138

139139
const unreachableFlow: FlowNode = { flags: FlowFlags.Unreachable };

0 commit comments

Comments
 (0)