Skip to content

Commit 9fd90e7

Browse files
committed
Merge branch 'master' into jsdoc-param-type-literals
2 parents 9e59dac + 5b77ef8 commit 9fd90e7

File tree

154 files changed

+853
-715
lines changed

Some content is hidden

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

154 files changed

+853
-715
lines changed

Gulpfile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ gulp.task("configure-nightly", "Runs scripts/configureNightly.ts to prepare a bu
294294
exec(host, [configureNightlyJs, packageJson, versionFile], done, done);
295295
});
296296
gulp.task("publish-nightly", "Runs `npm publish --tag next` to create a new nightly build on npm", ["LKG"], () => {
297-
return runSequence("clean", "useDebugMode", "runtests", (done) => {
297+
return runSequence("clean", "useDebugMode", "runtests-parallel", (done) => {
298298
exec("npm", ["publish", "--tag", "next"], done, done);
299299
});
300300
});

Jakefile.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ task("configure-nightly", [configureNightlyJs], function () {
505505
}, { async: true });
506506

507507
desc("Configure, build, test, and publish the nightly release.");
508-
task("publish-nightly", ["configure-nightly", "LKG", "clean", "setDebugMode", "runtests"], function () {
508+
task("publish-nightly", ["configure-nightly", "LKG", "clean", "setDebugMode", "runtests-parallel"], function () {
509509
var cmd = "npm publish --tag next";
510510
console.log(cmd);
511511
exec(cmd);
@@ -840,7 +840,8 @@ function runConsoleTests(defaultReporter, runInParallel) {
840840
testTimeout = 800000;
841841
}
842842

843-
var colors = process.env.colors || process.env.color || true;
843+
var colorsFlag = process.env.color || process.env.colors;
844+
var colors = colorsFlag !== "false" && colorsFlag !== "0";
844845
var reporter = process.env.reporter || process.env.r || defaultReporter;
845846
var bail = process.env.bail || process.env.b;
846847
var lintFlag = process.env.lint !== 'false';

src/compiler/binder.ts

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ namespace ts {
242242
}
243243

244244
Debug.assert(isWellKnownSymbolSyntactically(nameExpression));
245-
return getPropertyNameForKnownSymbolName(unescapeLeadingUnderscores((<PropertyAccessExpression>nameExpression).name.text));
245+
return getPropertyNameForKnownSymbolName(unescapeLeadingUnderscores((<PropertyAccessExpression>nameExpression).name.escapedText));
246246
}
247247
return getEscapedTextOfIdentifierOrLiteral(<Identifier | LiteralExpression>name);
248248
}
@@ -287,8 +287,8 @@ namespace ts {
287287
if (parentNode && parentNode.kind === SyntaxKind.VariableStatement) {
288288
if ((<VariableStatement>parentNode).declarationList.declarations.length > 0) {
289289
const nameIdentifier = (<VariableStatement>parentNode).declarationList.declarations[0].name;
290-
if (nameIdentifier.kind === SyntaxKind.Identifier) {
291-
nameFromParentNode = (<Identifier>nameIdentifier).text;
290+
if (isIdentifier(nameIdentifier)) {
291+
nameFromParentNode = nameIdentifier.escapedText;
292292
}
293293
}
294294
}
@@ -1031,7 +1031,7 @@ namespace ts {
10311031
function bindBreakOrContinueStatement(node: BreakOrContinueStatement): void {
10321032
bind(node.label);
10331033
if (node.label) {
1034-
const activeLabel = findActiveLabel(node.label.text);
1034+
const activeLabel = findActiveLabel(node.label.escapedText);
10351035
if (activeLabel) {
10361036
activeLabel.referenced = true;
10371037
bindBreakOrContinueFlow(node, activeLabel.breakTarget, activeLabel.continueTarget);
@@ -1192,7 +1192,7 @@ namespace ts {
11921192
const postStatementLabel = createBranchLabel();
11931193
bind(node.label);
11941194
addAntecedent(preStatementLabel, currentFlow);
1195-
const activeLabel = pushActiveLabel(node.label.text, postStatementLabel, preStatementLabel);
1195+
const activeLabel = pushActiveLabel(node.label.escapedText, postStatementLabel, preStatementLabel);
11961196
bind(node.statement);
11971197
popActiveLabel();
11981198
if (!activeLabel.referenced && !options.allowUnusedLabels) {
@@ -1649,7 +1649,7 @@ namespace ts {
16491649
const typeLiteralSymbol = createSymbol(SymbolFlags.TypeLiteral, InternalSymbolName.Type);
16501650
addDeclarationToSymbol(typeLiteralSymbol, node, SymbolFlags.TypeLiteral);
16511651
typeLiteralSymbol.members = createSymbolTable();
1652-
typeLiteralSymbol.members.set(symbol.name, symbol);
1652+
typeLiteralSymbol.members.set(symbol.escapedName, symbol);
16531653
}
16541654

16551655
function bindObjectLiteralExpression(node: ObjectLiteralExpression) {
@@ -1680,9 +1680,9 @@ namespace ts {
16801680
? ElementKind.Property
16811681
: ElementKind.Accessor;
16821682

1683-
const existingKind = seen.get(identifier.text);
1683+
const existingKind = seen.get(identifier.escapedText);
16841684
if (!existingKind) {
1685-
seen.set(identifier.text, currentKind);
1685+
seen.set(identifier.escapedText, currentKind);
16861686
continue;
16871687
}
16881688

@@ -1792,8 +1792,7 @@ namespace ts {
17921792
}
17931793

17941794
function isEvalOrArgumentsIdentifier(node: Node): boolean {
1795-
return node.kind === SyntaxKind.Identifier &&
1796-
((<Identifier>node).text === "eval" || (<Identifier>node).text === "arguments");
1795+
return isIdentifier(node) && (node.escapedText === "eval" || node.escapedText === "arguments");
17971796
}
17981797

17991798
function checkStrictModeEvalOrArguments(contextNode: Node, name: Node) {
@@ -1804,7 +1803,7 @@ namespace ts {
18041803
// otherwise report generic error message.
18051804
const span = getErrorSpanForNode(file, name);
18061805
file.bindDiagnostics.push(createFileDiagnostic(file, span.start, span.length,
1807-
getStrictModeEvalOrArgumentsMessage(contextNode), unescapeLeadingUnderscores(identifier.text)));
1806+
getStrictModeEvalOrArgumentsMessage(contextNode), unescapeLeadingUnderscores(identifier.escapedText)));
18081807
}
18091808
}
18101809
}
@@ -2300,14 +2299,10 @@ namespace ts {
23002299
}
23012300

23022301
function isNameOfExportsOrModuleExportsAliasDeclaration(node: Node) {
2303-
if (node.kind === SyntaxKind.Identifier) {
2304-
const symbol = lookupSymbolForName((<Identifier>node).text);
2305-
if (symbol && symbol.valueDeclaration && symbol.valueDeclaration.kind === SyntaxKind.VariableDeclaration) {
2306-
const declaration = symbol.valueDeclaration as VariableDeclaration;
2307-
if (declaration.initializer) {
2308-
return isExportsOrModuleExportsOrAliasOrAssignment(declaration.initializer);
2309-
}
2310-
}
2302+
if (isIdentifier(node)) {
2303+
const symbol = lookupSymbolForName(node.escapedText);
2304+
return symbol && symbol.valueDeclaration && isVariableDeclaration(symbol.valueDeclaration) &&
2305+
symbol.valueDeclaration.initializer && isExportsOrModuleExportsOrAliasOrAssignment(symbol.valueDeclaration.initializer);
23112306
}
23122307
return false;
23132308
}
@@ -2374,7 +2369,7 @@ namespace ts {
23742369
constructorFunction.parent = classPrototype;
23752370
classPrototype.parent = leftSideOfAssignment;
23762371

2377-
bindPropertyAssignment(constructorFunction.text, leftSideOfAssignment, /*isPrototypeProperty*/ true);
2372+
bindPropertyAssignment(constructorFunction.escapedText, leftSideOfAssignment, /*isPrototypeProperty*/ true);
23782373
}
23792374

23802375
function bindStaticPropertyAssignment(node: BinaryExpression) {
@@ -2396,7 +2391,7 @@ namespace ts {
23962391
bindExportsPropertyAssignment(node);
23972392
}
23982393
else {
2399-
bindPropertyAssignment(target.text, leftSideOfAssignment, /*isPrototypeProperty*/ false);
2394+
bindPropertyAssignment(target.escapedText, leftSideOfAssignment, /*isPrototypeProperty*/ false);
24002395
}
24012396
}
24022397

@@ -2437,11 +2432,11 @@ namespace ts {
24372432
bindBlockScopedDeclaration(node, SymbolFlags.Class, SymbolFlags.ClassExcludes);
24382433
}
24392434
else {
2440-
const bindingName = node.name ? node.name.text : InternalSymbolName.Class;
2435+
const bindingName = node.name ? node.name.escapedText : InternalSymbolName.Class;
24412436
bindAnonymousDeclaration(node, SymbolFlags.Class, bindingName);
24422437
// Add name of class expression into the map for semantic classifier
24432438
if (node.name) {
2444-
classifiableNames.set(node.name.text, true);
2439+
classifiableNames.set(node.name.escapedText, true);
24452440
}
24462441
}
24472442

@@ -2457,14 +2452,14 @@ namespace ts {
24572452
// module might have an exported variable called 'prototype'. We can't allow that as
24582453
// that would clash with the built-in 'prototype' for the class.
24592454
const prototypeSymbol = createSymbol(SymbolFlags.Property | SymbolFlags.Prototype, "prototype" as __String);
2460-
const symbolExport = symbol.exports.get(prototypeSymbol.name);
2455+
const symbolExport = symbol.exports.get(prototypeSymbol.escapedName);
24612456
if (symbolExport) {
24622457
if (node.name) {
24632458
node.name.parent = node;
24642459
}
2465-
file.bindDiagnostics.push(createDiagnosticForNode(symbolExport.declarations[0], Diagnostics.Duplicate_identifier_0, unescapeLeadingUnderscores(prototypeSymbol.name)));
2460+
file.bindDiagnostics.push(createDiagnosticForNode(symbolExport.declarations[0], Diagnostics.Duplicate_identifier_0, unescapeLeadingUnderscores(prototypeSymbol.escapedName)));
24662461
}
2467-
symbol.exports.set(prototypeSymbol.name, prototypeSymbol);
2462+
symbol.exports.set(prototypeSymbol.escapedName, prototypeSymbol);
24682463
prototypeSymbol.parent = symbol;
24692464
}
24702465

@@ -2550,7 +2545,7 @@ namespace ts {
25502545
node.flowNode = currentFlow;
25512546
}
25522547
checkStrictModeFunctionName(node);
2553-
const bindingName = node.name ? node.name.text : InternalSymbolName.Function;
2548+
const bindingName = node.name ? node.name.escapedText : InternalSymbolName.Function;
25542549
return bindAnonymousDeclaration(node, SymbolFlags.Function, bindingName);
25552550
}
25562551

0 commit comments

Comments
 (0)