Skip to content

Commit 4d13f53

Browse files
committed
Merge branch 'master' into referencesPrototypeSourceFile
2 parents f72af3b + af20e79 commit 4d13f53

File tree

181 files changed

+2657
-903
lines changed

Some content is hidden

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

181 files changed

+2657
-903
lines changed

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
}

scripts/update-experimental-branches.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,23 @@ const { runSequence } = require("./run-sequence");
77
const triggeredPR = process.env.SOURCE_ISSUE || process.env.SYSTEM_PULLREQUEST_PULLREQUESTNUMBER;
88

99
/**
10-
* This program should be invoked as `node ./scripts/update-experimental-branches <GithubAccessToken> <PR1> [PR2] [...]`
11-
* The order PR numbers are passed controls the order in which they are merged together.
10+
* This program should be invoked as `node ./scripts/update-experimental-branches <GithubAccessToken>`
1211
* TODO: the following is racey - if two experiment-enlisted PRs trigger simultaneously and witness one another in an unupdated state, they'll both produce
1312
* a new experimental branch, but each will be missing a change from the other. There's no _great_ way to fix this beyond setting the maximum concurrency
1413
* of this task to 1 (so only one job is allowed to update experiments at a time).
1514
*/
1615
async function main() {
17-
const prnums = process.argv.slice(3);
18-
if (!prnums.length) {
19-
return; // No enlisted PRs, nothing to update
20-
}
21-
if (triggeredPR && !prnums.some(n => n === triggeredPR)) {
16+
const gh = new Octokit({
17+
auth: process.argv[2]
18+
});
19+
const prnums = (await gh.issues.listForRepo({
20+
labels: "typescript@experimental",
21+
sort: "created",
22+
state: "open",
23+
owner: "Microsoft",
24+
repo: "TypeScript",
25+
})).data.filter(i => !!i.pull_request).map(i => i.number);
26+
if (triggeredPR && !prnums.some(n => n === +triggeredPR)) {
2227
return; // Only have work to do for enlisted PRs
2328
}
2429
console.log(`Performing experimental branch updating and merging for pull requests ${prnums.join(", ")}`);
@@ -34,9 +39,6 @@ async function main() {
3439
["git", ["remote", "add", "fork", remoteUrl]], // Add the remote fork
3540
]);
3641

37-
const gh = new Octokit({
38-
auth: process.argv[2]
39-
});
4042
for (const numRaw of prnums) {
4143
const num = +numRaw;
4244
if (num) {

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));

src/compiler/checker.ts

Lines changed: 153 additions & 48 deletions
Large diffs are not rendered by default.

src/compiler/commandLineParser.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ namespace ts {
245245
esnext: ModuleKind.ESNext
246246
}),
247247
affectsModuleResolution: true,
248+
affectsEmit: true,
248249
paramType: Diagnostics.KIND,
249250
showInSimplifiedHelpView: true,
250251
category: Diagnostics.Basic_Options,
@@ -590,6 +591,7 @@ namespace ts {
590591
name: "esModuleInterop",
591592
type: "boolean",
592593
affectsSemanticDiagnostics: true,
594+
affectsEmit: true,
593595
showInSimplifiedHelpView: true,
594596
category: Diagnostics.Module_Resolution_Options,
595597
description: Diagnostics.Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports

src/compiler/diagnosticMessages.json

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,15 +1236,15 @@
12361236
"category": "Error",
12371237
"code": 2348
12381238
},
1239-
"Cannot invoke an expression whose type lacks a call signature. Type '{0}' has no compatible call signatures.": {
1239+
"This expression is not callable.": {
12401240
"category": "Error",
12411241
"code": 2349
12421242
},
12431243
"Only a void function can be called with the 'new' keyword.": {
12441244
"category": "Error",
12451245
"code": 2350
12461246
},
1247-
"Cannot use 'new' with an expression whose type lacks a call or construct signature.": {
1247+
"This expression is not constructable.": {
12481248
"category": "Error",
12491249
"code": 2351
12501250
},
@@ -2621,6 +2621,38 @@
26212621
"category": "Error",
26222622
"code": 2754
26232623
},
2624+
"No constituent of type '{0}' is callable.": {
2625+
"category": "Error",
2626+
"code": 2755
2627+
},
2628+
"Not all constituents of type '{0}' are callable.": {
2629+
"category": "Error",
2630+
"code": 2756
2631+
},
2632+
"Type '{0}' has no call signatures.": {
2633+
"category": "Error",
2634+
"code": 2757
2635+
},
2636+
"Each member of the union type '{0}' has signatures, but none of those signatures are compatible with each other.": {
2637+
"category": "Error",
2638+
"code": 2758
2639+
},
2640+
"No constituent of type '{0}' is constructable.": {
2641+
"category": "Error",
2642+
"code": 2759
2643+
},
2644+
"Not all constituents of type '{0}' are constructable.": {
2645+
"category": "Error",
2646+
"code": 2760
2647+
},
2648+
"Type '{0}' has no construct signatures.": {
2649+
"category": "Error",
2650+
"code": 2761
2651+
},
2652+
"Each member of the union type '{0}' has construct signatures, but none of those signatures are compatible with each other.": {
2653+
"category": "Error",
2654+
"code": 2762
2655+
},
26242656

26252657
"Import declaration '{0}' is using private name '{1}'.": {
26262658
"category": "Error",

src/compiler/program.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,7 @@ namespace ts {
14251425
}
14261426
}
14271427
// Set the file as found during node modules search if it was found that way in old progra,
1428-
if (oldProgram.isSourceFileFromExternalLibrary(oldProgram.getSourceFileByPath(filePath)!)) {
1428+
if (oldProgram.isSourceFileFromExternalLibrary(oldProgram.getSourceFileByPath(newSourceFile.resolvedPath)!)) {
14291429
sourceFilesFoundSearchingNodeModules.set(filePath, true);
14301430
}
14311431
}

0 commit comments

Comments
 (0)