Skip to content

Commit 42f3980

Browse files
author
Kanchalai Tanglertsampan
committed
Merge branch 'master' into master-14217
# Conflicts: # tests/baselines/reference/classOrder2.errors.txt # tests/baselines/reference/es5ExportDefaultClassDeclaration3.symbols # tests/baselines/reference/es5ExportDefaultClassDeclaration3.types # tests/baselines/reference/mappedTypeRelationships.errors.txt # tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt
2 parents 63f3520 + 3ab7c86 commit 42f3980

File tree

524 files changed

+7792
-5402
lines changed

Some content is hidden

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

524 files changed

+7792
-5402
lines changed

Gulpfile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ gulp.task("lint", "Runs tslint on the compiler sources. Optional arguments are:
10241024
const fileMatcher = cmdLineOptions["files"];
10251025
const files = fileMatcher
10261026
? `src/**/${fileMatcher}`
1027-
: "Gulpfile.ts 'src/**/*.ts' --exclude src/lib/es5.d.ts --exclude 'src/lib/*.generated.d.ts' --exclude 'src/harness/unittests/services/**/*.ts'";
1027+
: "Gulpfile.ts 'src/**/*.ts' --exclude src/lib/es5.d.ts --exclude 'src/lib/*.generated.d.ts'";
10281028
const cmd = `node node_modules/tslint/bin/tslint ${files} --format stylish`;
10291029
console.log("Linting: " + cmd);
10301030
child_process.execSync(cmd, { stdio: [0, 1, 2] });

Jakefile.js

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ var thirdParty = "ThirdPartyNoticeText.txt";
2929
var nodeModulesPathPrefix = path.resolve("./node_modules/.bin/") + path.delimiter;
3030
if (process.env.path !== undefined) {
3131
process.env.path = nodeModulesPathPrefix + process.env.path;
32-
} else if (process.env.PATH !== undefined) {
32+
}
33+
else if (process.env.PATH !== undefined) {
3334
process.env.PATH = nodeModulesPathPrefix + process.env.PATH;
3435
}
3536

@@ -312,13 +313,15 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, opts
312313
if (useDebugMode) {
313314
if (opts.inlineSourceMap) {
314315
options += " --inlineSourceMap --inlineSources";
315-
} else {
316+
}
317+
else {
316318
options += " -sourcemap";
317319
if (!opts.noMapRoot) {
318320
options += " -mapRoot file:///" + path.resolve(path.dirname(outFile));
319321
}
320322
}
321-
} else {
323+
}
324+
else {
322325
options += " --newLine LF";
323326
}
324327

@@ -748,7 +751,8 @@ function exec(cmd, completeHandler, errorHandler) {
748751
ex.addListener("error", function (e, status) {
749752
if (errorHandler) {
750753
errorHandler(e, status);
751-
} else {
754+
}
755+
else {
752756
fail("Process exited with code " + status);
753757
}
754758
});
@@ -942,7 +946,7 @@ task("generate-code-coverage", ["tests", builtLocalDirectory], function () {
942946
// Browser tests
943947
var nodeServerOutFile = "tests/webTestServer.js";
944948
var nodeServerInFile = "tests/webTestServer.ts";
945-
compileFile(nodeServerOutFile, [nodeServerInFile], [builtLocalDirectory, tscFile], [], /*useBuiltCompiler:*/ true, { noOutFile: true });
949+
compileFile(nodeServerOutFile, [nodeServerInFile], [builtLocalDirectory, tscFile], [], /*useBuiltCompiler:*/ true, { noOutFile: true, lib: "es6" });
946950

947951
desc("Runs browserify on run.js to produce a file suitable for running tests in the browser");
948952
task("browserify", ["tests", builtLocalDirectory, nodeServerOutFile], function() {
@@ -1006,21 +1010,32 @@ task("baseline-accept", function () {
10061010

10071011
function acceptBaseline(sourceFolder, targetFolder) {
10081012
console.log('Accept baselines from ' + sourceFolder + ' to ' + targetFolder);
1009-
var files = fs.readdirSync(sourceFolder);
10101013
var deleteEnding = '.delete';
1011-
for (var i in files) {
1012-
var filename = files[i];
1013-
var fullLocalPath = path.join(sourceFolder, filename);
1014-
if (fs.statSync(fullLocalPath).isFile()) {
1015-
if (filename.substr(filename.length - deleteEnding.length) === deleteEnding) {
1016-
filename = filename.substr(0, filename.length - deleteEnding.length);
1017-
fs.unlinkSync(path.join(targetFolder, filename));
1018-
} else {
1019-
var target = path.join(targetFolder, filename);
1020-
if (fs.existsSync(target)) {
1021-
fs.unlinkSync(target);
1014+
1015+
acceptBaselineFolder(sourceFolder, targetFolder);
1016+
1017+
function acceptBaselineFolder(sourceFolder, targetFolder) {
1018+
var files = fs.readdirSync(sourceFolder);
1019+
1020+
for (var i in files) {
1021+
var filename = files[i];
1022+
var fullLocalPath = path.join(sourceFolder, filename);
1023+
var stat = fs.statSync(fullLocalPath);
1024+
if (stat.isFile()) {
1025+
if (filename.substr(filename.length - deleteEnding.length) === deleteEnding) {
1026+
filename = filename.substr(0, filename.length - deleteEnding.length);
1027+
fs.unlinkSync(path.join(targetFolder, filename));
1028+
}
1029+
else {
1030+
var target = path.join(targetFolder, filename);
1031+
if (fs.existsSync(target)) {
1032+
fs.unlinkSync(target);
1033+
}
1034+
fs.renameSync(path.join(sourceFolder, filename), target);
10221035
}
1023-
fs.renameSync(path.join(sourceFolder, filename), target);
1036+
}
1037+
else if (stat.isDirectory()) {
1038+
acceptBaselineFolder(fullLocalPath, path.join(targetFolder, filename));
10241039
}
10251040
}
10261041
}
@@ -1182,7 +1197,7 @@ task("lint", ["build-rules"], () => {
11821197
const fileMatcher = process.env.f || process.env.file || process.env.files;
11831198
const files = fileMatcher
11841199
? `src/**/${fileMatcher}`
1185-
: "Gulpfile.ts 'src/**/*.ts' --exclude src/lib/es5.d.ts --exclude 'src/lib/*.generated.d.ts' --exclude 'src/harness/unittests/services/**/*.ts'";
1200+
: "Gulpfile.ts 'src/**/*.ts' --exclude src/lib/es5.d.ts --exclude 'src/lib/*.generated.d.ts'";
11861201
const cmd = `node node_modules/tslint/bin/tslint ${files} --format stylish`;
11871202
console.log("Linting: " + cmd);
11881203
jake.exec([cmd], { interactive: true }, () => {

lib/tsc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53977,7 +53977,7 @@ var ts;
5397753977
var padding = makePadding(marginLength);
5397853978
output.push(getDiagnosticText(ts.Diagnostics.Examples_Colon_0, makePadding(marginLength - examplesLength) + "tsc hello.ts") + ts.sys.newLine);
5397953979
output.push(padding + "tsc --outFile file.js file.ts" + ts.sys.newLine);
53980-
output.push(padding + "tsc @args.txt" + ts.sys.newLine);
53980+
output.push(padding + "tsc --project tsconfig.json" + ts.sys.newLine);
5398153981
output.push(ts.sys.newLine);
5398253982
output.push(getDiagnosticText(ts.Diagnostics.Options_Colon) + ts.sys.newLine);
5398353983
var optsList = ts.filter(ts.optionDeclarations.slice(), function (v) { return !v.experimental; });

src/compiler/binder.ts

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ namespace ts {
259259
case SyntaxKind.ExportAssignment:
260260
return (<ExportAssignment>node).isExportEquals ? "export=" : "default";
261261
case SyntaxKind.BinaryExpression:
262-
switch (getSpecialPropertyAssignmentKind(node)) {
262+
switch (getSpecialPropertyAssignmentKind(node as BinaryExpression)) {
263263
case SpecialPropertyAssignmentKind.ModuleExports:
264264
// module.exports = ...
265265
return "export=";
@@ -2017,30 +2017,28 @@ namespace ts {
20172017
}
20182018
break;
20192019
case SyntaxKind.BinaryExpression:
2020-
if (isInJavaScriptFile(node)) {
2021-
const specialKind = getSpecialPropertyAssignmentKind(node);
2022-
switch (specialKind) {
2023-
case SpecialPropertyAssignmentKind.ExportsProperty:
2024-
bindExportsPropertyAssignment(<BinaryExpression>node);
2025-
break;
2026-
case SpecialPropertyAssignmentKind.ModuleExports:
2027-
bindModuleExportsAssignment(<BinaryExpression>node);
2028-
break;
2029-
case SpecialPropertyAssignmentKind.PrototypeProperty:
2030-
bindPrototypePropertyAssignment(<BinaryExpression>node);
2031-
break;
2032-
case SpecialPropertyAssignmentKind.ThisProperty:
2033-
bindThisPropertyAssignment(<BinaryExpression>node);
2034-
break;
2035-
case SpecialPropertyAssignmentKind.Property:
2036-
bindStaticPropertyAssignment(<BinaryExpression>node);
2037-
break;
2038-
case SpecialPropertyAssignmentKind.None:
2039-
// Nothing to do
2040-
break;
2041-
default:
2042-
Debug.fail("Unknown special property assignment kind");
2043-
}
2020+
const specialKind = getSpecialPropertyAssignmentKind(node as BinaryExpression);
2021+
switch (specialKind) {
2022+
case SpecialPropertyAssignmentKind.ExportsProperty:
2023+
bindExportsPropertyAssignment(<BinaryExpression>node);
2024+
break;
2025+
case SpecialPropertyAssignmentKind.ModuleExports:
2026+
bindModuleExportsAssignment(<BinaryExpression>node);
2027+
break;
2028+
case SpecialPropertyAssignmentKind.PrototypeProperty:
2029+
bindPrototypePropertyAssignment(<BinaryExpression>node);
2030+
break;
2031+
case SpecialPropertyAssignmentKind.ThisProperty:
2032+
bindThisPropertyAssignment(<BinaryExpression>node);
2033+
break;
2034+
case SpecialPropertyAssignmentKind.Property:
2035+
bindStaticPropertyAssignment(<BinaryExpression>node);
2036+
break;
2037+
case SpecialPropertyAssignmentKind.None:
2038+
// Nothing to do
2039+
break;
2040+
default:
2041+
Debug.fail("Unknown special property assignment kind");
20442042
}
20452043
return checkStrictModeBinaryExpression(<BinaryExpression>node);
20462044
case SyntaxKind.CatchClause:

0 commit comments

Comments
 (0)