Skip to content

Commit ed35741

Browse files
committed
Merge branch 'master' into incrementalBuildInfo
2 parents 8b06115 + 5ec5e04 commit ed35741

File tree

226 files changed

+3794
-1385
lines changed

Some content is hidden

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

226 files changed

+3794
-1385
lines changed

.npmignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ tests
1212
tslint.json
1313
Jakefile.js
1414
.editorconfig
15+
.failed-tests
16+
.git
17+
.git/
1518
.gitattributes
19+
.github/
1620
.gitmodules
1721
.settings/
1822
.travis.yml
@@ -23,6 +27,5 @@ Jakefile.js
2327
test.config
2428
package-lock.json
2529
yarn.lock
26-
.github/
2730
CONTRIBUTING.md
2831
TEST-results.xml

Gulpfile.js

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,34 @@ task("lint").flags = {
461461
" --f[iles]=<regex>": "pattern to match files to lint",
462462
};
463463

464+
const buildCancellationToken = () => buildProject("src/cancellationToken");
465+
const cleanCancellationToken = () => cleanProject("src/cancellationToken");
466+
cleanTasks.push(cleanCancellationToken);
467+
468+
const buildTypingsInstaller = () => buildProject("src/typingsInstaller");
469+
const cleanTypingsInstaller = () => cleanProject("src/typingsInstaller");
470+
cleanTasks.push(cleanTypingsInstaller);
471+
472+
const buildWatchGuard = () => buildProject("src/watchGuard");
473+
const cleanWatchGuard = () => cleanProject("src/watchGuard");
474+
cleanTasks.push(cleanWatchGuard);
475+
476+
const generateTypesMap = () => src("src/server/typesMap.json")
477+
.pipe(newer("built/local/typesMap.json"))
478+
.pipe(transform(contents => (JSON.parse(contents), contents))) // validates typesMap.json is valid JSON
479+
.pipe(dest("built/local"));
480+
task("generate-types-map", generateTypesMap);
481+
482+
const cleanTypesMap = () => del("built/local/typesMap.json");
483+
cleanTasks.push(cleanTypesMap);
484+
485+
const buildOtherOutputs = parallel(buildCancellationToken, buildTypingsInstaller, buildWatchGuard, generateTypesMap);
486+
task("other-outputs", series(preBuild, buildOtherOutputs));
487+
task("other-outputs").description = "Builds miscelaneous scripts and documents distributed with the LKG";
488+
464489
const buildFoldStart = async () => { if (fold.isTravis()) console.log(fold.start("build")); };
465490
const buildFoldEnd = async () => { if (fold.isTravis()) console.log(fold.end("build")); };
466-
task("local", series(buildFoldStart, preBuild, parallel(localize, buildTsc, buildServer, buildServices, buildLssl), buildFoldEnd));
491+
task("local", series(buildFoldStart, preBuild, parallel(localize, buildTsc, buildServer, buildServices, buildLssl, buildOtherOutputs), buildFoldEnd));
467492
task("local").description = "Builds the full compiler and services";
468493
task("local").flags = {
469494
" --built": "Compile using the built version of the compiler."
@@ -639,28 +664,6 @@ const buildReleaseTsc = () => buildProject("src/tsc/tsconfig.release.json");
639664
const cleanReleaseTsc = () => cleanProject("src/tsc/tsconfig.release.json");
640665
cleanTasks.push(cleanReleaseTsc);
641666

642-
const buildCancellationToken = () => buildProject("src/cancellationToken");
643-
const cleanCancellationToken = () => cleanProject("src/cancellationToken");
644-
cleanTasks.push(cleanCancellationToken);
645-
646-
const buildTypingsInstaller = () => buildProject("src/typingsInstaller");
647-
const cleanTypingsInstaller = () => cleanProject("src/typingsInstaller");
648-
cleanTasks.push(cleanTypingsInstaller);
649-
650-
const buildWatchGuard = () => buildProject("src/watchGuard");
651-
const cleanWatchGuard = () => cleanProject("src/watchGuard");
652-
cleanTasks.push(cleanWatchGuard);
653-
654-
// TODO(rbuckton): This task isn't triggered by any other task. Is it still needed?
655-
const generateTypesMap = () => src("src/server/typesMap.json")
656-
.pipe(newer("built/local/typesMap.json"))
657-
.pipe(transform(contents => (JSON.parse(contents), contents))) // validates typesMap.json is valid JSON
658-
.pipe(dest("built/local"));
659-
task("generate-types-map", generateTypesMap);
660-
661-
const cleanTypesMap = () => del("built/local/typesMap.json");
662-
cleanTasks.push(cleanTypesMap);
663-
664667
const cleanBuilt = () => del("built");
665668

666669
const produceLKG = async () => {
@@ -690,7 +693,7 @@ const produceLKG = async () => {
690693
}
691694
};
692695

693-
task("LKG", series(lkgPreBuild, parallel(localize, buildTsc, buildServer, buildServices, buildLssl, buildCancellationToken, buildTypingsInstaller, buildWatchGuard, buildReleaseTsc), produceLKG));
696+
task("LKG", series(lkgPreBuild, parallel(localize, buildTsc, buildServer, buildServices, buildLssl, buildOtherOutputs, buildReleaseTsc), produceLKG));
694697
task("LKG").description = "Makes a new LKG out of the built js files";
695698
task("LKG").flags = {
696699
" --built": "Compile using the built version of the compiler.",

scripts/build/utils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,6 @@ function rm(dest, opts) {
340340
duplex.push(file);
341341
cb();
342342
}
343-
duplex.push(null); // signal end of read queue
344343
};
345344

346345
const duplex = new Duplex({
@@ -374,15 +373,16 @@ function rm(dest, opts) {
374373
pending.push(entry);
375374
},
376375
final(cb) {
376+
const endThenCb = () => (duplex.push(null), cb()); // signal end of read queue
377377
processDeleted();
378378
if (pending.length) {
379379
Promise
380380
.all(pending.map(entry => entry.promise))
381381
.then(() => processDeleted())
382-
.then(() => cb(), cb);
382+
.then(() => endThenCb(), endThenCb);
383383
return;
384384
}
385-
cb();
385+
endThenCb();
386386
},
387387
read() {
388388
}

src/compiler/binder.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2499,8 +2499,13 @@ namespace ts {
24992499
declareSymbol(symbolTable, containingClass.symbol, node, SymbolFlags.Property, SymbolFlags.None, /*isReplaceableByMethod*/ true);
25002500
break;
25012501
case SyntaxKind.SourceFile:
2502-
// this.foo assignment in a source file
2503-
// Do not bind. It would be nice to support this someday though.
2502+
// this.property = assignment in a source file -- declare symbol in exports for a module, in locals for a script
2503+
if ((thisContainer as SourceFile).commonJsModuleIndicator) {
2504+
declareSymbol(thisContainer.symbol.exports!, thisContainer.symbol, node, SymbolFlags.Property | SymbolFlags.ExportValue, SymbolFlags.None);
2505+
}
2506+
else {
2507+
declareSymbolAndAddToSymbolTable(node, SymbolFlags.FunctionScopedVariable, SymbolFlags.FunctionScopedVariableExcludes);
2508+
}
25042509
break;
25052510

25062511
default:

0 commit comments

Comments
 (0)