Skip to content

Commit e62d84c

Browse files
committed
Merge branch 'master' into report-multiple-overload-errors
2 parents de52797 + 340f810 commit e62d84c

File tree

140 files changed

+2354
-654
lines changed

Some content is hidden

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

140 files changed

+2354
-654
lines changed

Gulpfile.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,8 @@ task("runtests").flags = {
415415
" --no-lint": "Disables lint",
416416
" --timeout=<ms>": "Overrides the default test timeout.",
417417
" --built": "Compile using the built version of the compiler.",
418+
" --shards": "Total number of shards running tests (default: 1)",
419+
" --shardId": "1-based ID of this shard (default: 1)",
418420
}
419421

420422
const runTestsParallel = () => runConsoleTests("built/local/run.js", "min", /*runInParallel*/ true, /*watchMode*/ false);
@@ -430,6 +432,8 @@ task("runtests-parallel").flags = {
430432
" --timeout=<ms>": "Overrides the default test timeout.",
431433
" --built": "Compile using the built version of the compiler.",
432434
" --skipPercent=<number>": "Skip expensive tests with <percent> chance to miss an edit. Default 5%.",
435+
" --shards": "Total number of shards running tests (default: 1)",
436+
" --shardId": "1-based ID of this shard (default: 1)",
433437
};
434438

435439
task("diff", () => exec(getDiffTool(), [refBaseline, localBaseline], { ignoreExitCode: true }));

scripts/build/options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const os = require("os");
55
/** @type {CommandLineOptions} */
66
module.exports = minimist(process.argv.slice(2), {
77
boolean: ["debug", "dirty", "inspect", "light", "colors", "lint", "lkg", "soft", "fix", "failed", "keepFailed", "force", "built"],
8-
string: ["browser", "tests", "host", "reporter", "stackTraceLimit", "timeout"],
8+
string: ["browser", "tests", "host", "reporter", "stackTraceLimit", "timeout", "shards", "shardId"],
99
alias: {
1010
"b": "browser",
1111
"d": "debug", "debug-brk": "debug",

scripts/build/tests.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode,
3636
const testConfigFile = "test.config";
3737
const failed = cmdLineOptions.failed;
3838
const keepFailed = cmdLineOptions.keepFailed;
39+
const shards = +cmdLineOptions.shards || undefined;
40+
const shardId = +cmdLineOptions.shardId || undefined;
3941
if (!cmdLineOptions.dirty) {
4042
await cleanTestDirs();
4143
cancelToken.throwIfCancellationRequested();
@@ -63,8 +65,8 @@ async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode,
6365
testTimeout = 400000;
6466
}
6567

66-
if (tests || runners || light || testTimeout || taskConfigsFolder || keepFailed || skipPercent !== undefined) {
67-
writeTestConfigFile(tests, runners, light, skipPercent, taskConfigsFolder, workerCount, stackTraceLimit, testTimeout, keepFailed);
68+
if (tests || runners || light || testTimeout || taskConfigsFolder || keepFailed || skipPercent !== undefined || shards || shardId) {
69+
writeTestConfigFile(tests, runners, light, skipPercent, taskConfigsFolder, workerCount, stackTraceLimit, testTimeout, keepFailed, shards, shardId);
6870
}
6971

7072
const colors = cmdLineOptions.colors;
@@ -165,8 +167,10 @@ exports.cleanTestDirs = cleanTestDirs;
165167
* @param {string} [stackTraceLimit]
166168
* @param {string | number} [timeout]
167169
* @param {boolean} [keepFailed]
170+
* @param {number | undefined} [shards]
171+
* @param {number | undefined} [shardId]
168172
*/
169-
function writeTestConfigFile(tests, runners, light, skipPercent, taskConfigsFolder, workerCount, stackTraceLimit, timeout, keepFailed) {
173+
function writeTestConfigFile(tests, runners, light, skipPercent, taskConfigsFolder, workerCount, stackTraceLimit, timeout, keepFailed, shards, shardId) {
170174
const testConfigContents = JSON.stringify({
171175
test: tests ? [tests] : undefined,
172176
runners: runners ? runners.split(",") : undefined,
@@ -177,7 +181,9 @@ function writeTestConfigFile(tests, runners, light, skipPercent, taskConfigsFold
177181
taskConfigsFolder,
178182
noColor: !cmdLineOptions.colors,
179183
timeout,
180-
keepFailed
184+
keepFailed,
185+
shards,
186+
shardId
181187
});
182188
log.info("Running tests with config: " + testConfigContents);
183189
fs.writeFileSync("test.config", testConfigContents);

scripts/open-user-pr.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/// <reference lib="esnext.asynciterable" />
2+
/// <reference lib="es2015.promise" />
23
// Must reference esnext.asynciterable lib, since octokit uses AsyncIterable internally
34
import Octokit = require("@octokit/rest");
45
import {runSequence} from "./run-sequence";
@@ -29,7 +30,7 @@ gh.authenticate({
2930
token: process.argv[2]
3031
});
3132
gh.pulls.create({
32-
owner: process.env.TARGET_FORK,
33+
owner: process.env.TARGET_FORK!,
3334
repo: "TypeScript",
3435
maintainer_can_modify: true,
3536
title: `🤖 User test baselines have changed` + (process.env.TARGET_BRANCH ? ` for ${process.env.TARGET_BRANCH}` : ""),
@@ -45,9 +46,9 @@ cc ${reviewers.map(r => "@" + r).join(" ")}`,
4546
console.log(`Pull request ${num} created.`);
4647
if (!process.env.SOURCE_ISSUE) {
4748
await gh.pulls.createReviewRequest({
48-
owner: process.env.TARGET_FORK,
49+
owner: process.env.TARGET_FORK!,
4950
repo: "TypeScript",
50-
number: num,
51+
pull_number: num,
5152
reviewers,
5253
});
5354
}

src/compiler/binder.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@ namespace ts {
274274
if (isStringOrNumericLiteralLike(nameExpression)) {
275275
return escapeLeadingUnderscores(nameExpression.text);
276276
}
277+
if (isSignedNumericLiteral(nameExpression)) {
278+
return tokenToString(nameExpression.operator) + nameExpression.operand.text as __String;
279+
}
277280

278281
Debug.assert(isWellKnownSymbolSyntactically(nameExpression));
279282
return getPropertyNameForKnownSymbolName(idText((<PropertyAccessExpression>nameExpression).name));

0 commit comments

Comments
 (0)