Skip to content

Commit 87393e0

Browse files
committed
Merge branch 'master' into optimizeMaps
2 parents 3ff89f7 + 19d89c4 commit 87393e0

37 files changed

+1531
-240
lines changed

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ matrix:
1717
node_js: stable
1818
osx_image: xcode7.3
1919
env: workerCount=2
20+
allow_failures:
21+
- os: osx
2022

2123
branches:
2224
only:
@@ -32,3 +34,6 @@ install:
3234
cache:
3335
directories:
3436
- node_modules
37+
38+
git:
39+
depth: 1

Gulpfile.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import merge2 = require("merge2");
3535
import intoStream = require("into-stream");
3636
import * as os from "os";
3737
import Linter = require("tslint");
38+
import fold = require("travis-fold");
3839
const gulp = helpMaker(originalGulp);
3940
const mochaParallel = require("./scripts/mocha-parallel.js");
4041
const {runTestsInParallel} = mochaParallel;
@@ -964,6 +965,7 @@ gulp.task("lint", "Runs tslint on the compiler sources. Optional arguments are:
964965
const fileMatcher = RegExp(cmdLineOptions["files"]);
965966
const lintOptions = getLinterOptions();
966967
let failed = 0;
968+
if (fold.isTravis()) console.log(fold.start("lint"));
967969
return gulp.src(lintTargets)
968970
.pipe(insert.transform((contents, file) => {
969971
if (!fileMatcher.test(file.path)) return contents;
@@ -975,6 +977,7 @@ gulp.task("lint", "Runs tslint on the compiler sources. Optional arguments are:
975977
return contents; // TODO (weswig): Automatically apply fixes? :3
976978
}))
977979
.on("end", () => {
980+
if (fold.isTravis()) console.log(fold.end("lint"));
978981
if (failed > 0) {
979982
console.error("Linter errors.");
980983
process.exit(1);

Jakefile.js

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ var os = require("os");
55
var path = require("path");
66
var child_process = require("child_process");
77
var Linter = require("tslint");
8+
var fold = require("travis-fold");
89
var runTestsInParallel = require("./scripts/mocha-parallel").runTestsInParallel;
910

1011
// Variables
@@ -560,9 +561,19 @@ compileFile(
560561
desc("Builds language service server library");
561562
task("lssl", [tsserverLibraryFile, tsserverLibraryDefinitionFile]);
562563

564+
desc("Emit the start of the build fold");
565+
task("build-fold-start", [] , function() {
566+
if (fold.isTravis()) console.log(fold.start("build"));
567+
});
568+
569+
desc("Emit the end of the build fold");
570+
task("build-fold-end", [] , function() {
571+
if (fold.isTravis()) console.log(fold.end("build"));
572+
});
573+
563574
// Local target to build the compiler and services
564575
desc("Builds the full compiler and services");
565-
task("local", ["generate-diagnostics", "lib", tscFile, servicesFile, nodeDefinitionsFile, serverFile, builtGeneratedDiagnosticMessagesJSON, "lssl"]);
576+
task("local", ["build-fold-start", "generate-diagnostics", "lib", tscFile, servicesFile, nodeDefinitionsFile, serverFile, builtGeneratedDiagnosticMessagesJSON, "lssl", "build-fold-end"]);
566577

567578
// Local target to build only tsc.js
568579
desc("Builds only the compiler");
@@ -998,12 +1009,22 @@ var tslintRulesOutFiles = tslintRules.map(function(p) {
9981009
return path.join(builtLocalDirectory, "tslint", p + ".js");
9991010
});
10001011
desc("Compiles tslint rules to js");
1001-
task("build-rules", tslintRulesOutFiles);
1012+
task("build-rules", ["build-rules-start"].concat(tslintRulesOutFiles).concat(["build-rules-end"]));
10021013
tslintRulesFiles.forEach(function(ruleFile, i) {
10031014
compileFile(tslintRulesOutFiles[i], [ruleFile], [ruleFile], [], /*useBuiltCompiler*/ false,
10041015
{ noOutFile: true, generateDeclarations: false, outDir: path.join(builtLocalDirectory, "tslint")});
10051016
});
10061017

1018+
desc("Emit the start of the build-rules fold");
1019+
task("build-rules-start", [] , function() {
1020+
if (fold.isTravis()) console.log(fold.start("build-rules"));
1021+
});
1022+
1023+
desc("Emit the end of the build-rules fold");
1024+
task("build-rules-end", [] , function() {
1025+
if (fold.isTravis()) console.log(fold.end("build-rules"));
1026+
});
1027+
10071028
function getLinterOptions() {
10081029
return {
10091030
configuration: require("./tslint.json"),
@@ -1047,6 +1068,7 @@ var lintTargets = compilerSources
10471068

10481069
desc("Runs tslint on the compiler sources. Optional arguments are: f[iles]=regex");
10491070
task("lint", ["build-rules"], function() {
1071+
if (fold.isTravis()) console.log(fold.start("lint"));
10501072
var lintOptions = getLinterOptions();
10511073
var failed = 0;
10521074
var fileMatcher = RegExp(process.env.f || process.env.file || process.env.files || "");
@@ -1062,6 +1084,7 @@ task("lint", ["build-rules"], function() {
10621084
done[target] = true;
10631085
}
10641086
}
1087+
if (fold.isTravis()) console.log(fold.end("lint"));
10651088
if (failed > 0) {
10661089
fail('Linter errors.', failed);
10671090
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
},
3131
"devDependencies": {
3232
"@types/browserify": "latest",
33-
"@types/convert-source-map": "latest",
3433
"@types/chai": "latest",
34+
"@types/convert-source-map": "latest",
3535
"@types/del": "latest",
3636
"@types/glob": "latest",
3737
"@types/gulp": "latest",
@@ -72,6 +72,7 @@
7272
"run-sequence": "latest",
7373
"sorcery": "latest",
7474
"through2": "latest",
75+
"travis-fold": "latest",
7576
"ts-node": "latest",
7677
"tslint": "next",
7778
"typescript": "next"

scripts/types/ambient.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ declare module "into-stream" {
2222
}
2323

2424
declare module "sorcery";
25+
declare module "travis-fold";

src/compiler/binder.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1886,18 +1886,17 @@ namespace ts {
18861886
}
18871887

18881888
function bindExportAssignment(node: ExportAssignment | BinaryExpression) {
1889-
const boundExpression = node.kind === SyntaxKind.ExportAssignment ? (<ExportAssignment>node).expression : (<BinaryExpression>node).right;
18901889
if (!container.symbol || !container.symbol.exports) {
18911890
// Export assignment in some sort of block construct
18921891
bindAnonymousDeclaration(node, SymbolFlags.Alias, getDeclarationName(node));
18931892
}
1894-
else if (boundExpression.kind === SyntaxKind.Identifier && node.kind === SyntaxKind.ExportAssignment) {
1895-
// An export default clause with an identifier exports all meanings of that identifier
1896-
declareSymbol(container.symbol.exports, container.symbol, node, SymbolFlags.Alias, SymbolFlags.PropertyExcludes | SymbolFlags.AliasExcludes);
1897-
}
18981893
else {
1899-
// An export default clause with an expression exports a value
1900-
declareSymbol(container.symbol.exports, container.symbol, node, SymbolFlags.Property, SymbolFlags.PropertyExcludes | SymbolFlags.AliasExcludes);
1894+
const flags = node.kind === SyntaxKind.ExportAssignment && exportAssignmentIsAlias(<ExportAssignment>node)
1895+
// An export default clause with an EntityNameExpression exports all meanings of that identifier
1896+
? SymbolFlags.Alias
1897+
// An export default clause with any other expression exports a value
1898+
: SymbolFlags.Property;
1899+
declareSymbol(container.symbol.exports, container.symbol, node, flags, SymbolFlags.PropertyExcludes | SymbolFlags.AliasExcludes);
19011900
}
19021901
}
19031902

0 commit comments

Comments
 (0)