Skip to content

Commit 8896207

Browse files
committed
Merge branch 'master' into intersect-return-types
2 parents 35f064d + cd56398 commit 8896207

File tree

582 files changed

+17620
-5470
lines changed

Some content is hidden

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

582 files changed

+17620
-5470
lines changed

Gulpfile.js

+4
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,10 @@ const configureInsiders = () => exec(process.execPath, ["scripts/configurePrerel
545545
task("configure-insiders", series(buildScripts, configureInsiders));
546546
task("configure-insiders").description = "Runs scripts/configurePrerelease.ts to prepare a build for insiders publishing";
547547

548+
const configureExperimental = () => exec(process.execPath, ["scripts/configurePrerelease.js", "experimental", "package.json", "src/compiler/core.ts"])
549+
task("configure-experimental", series(buildScripts, configureExperimental));
550+
task("configure-experimental").description = "Runs scripts/configurePrerelease.ts to prepare a build for experimental publishing";
551+
548552
const publishNightly = () => exec("npm", ["publish", "--tag", "next"]);
549553
task("publish-nightly", series(task("clean"), task("LKG"), task("clean"), task("runtests-parallel"), publishNightly));
550554
task("publish-nightly").description = "Runs `npm publish --tag next` to create a new nightly build on npm";

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ gulp tests # Build the test infrastructure using the built compiler.
7979
gulp runtests # Run tests using the built compiler and test infrastructure.
8080
# You can override the host or specify a test for this command.
8181
# Use --host=<hostName> or --tests=<testPath>.
82-
gulp runtests-browser # Runs the tests using the built run.js file. Syntax is gulp runtests. Optional
83-
parameters '--host=', '--tests=[regex], --reporter=[list|spec|json|<more>]'.
8482
gulp baseline-accept # This replaces the baseline test results with the results obtained from gulp runtests.
8583
gulp lint # Runs tslint on the TypeScript source.
8684
gulp help # List the above commands.

lib/tsserver.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -33624,7 +33624,7 @@ var ts;
3362433624
return type;
3362533625
}
3362633626
// A reserved member name starts with two underscores, but the third character cannot be an underscore
33627-
// or the @ symbol. A third underscore indicates an escaped form of an identifer that started
33627+
// or the @ symbol. A third underscore indicates an escaped form of an identifier that started
3362833628
// with at least two underscores. The @ character indicates that the name is denoted by a well known ES
3362933629
// Symbol instance.
3363033630
function isReservedMemberName(name) {
@@ -99911,9 +99911,9 @@ var ts;
9991199911
|| ts.isKnownSymbol(symbol)) {
9991299912
return undefined;
9991399913
}
99914-
var validIdentiferResult = { name: name, needsConvertPropertyAccess: false };
99914+
var validIdentifierResult = { name: name, needsConvertPropertyAccess: false };
9991599915
if (ts.isIdentifierText(name, target))
99916-
return validIdentiferResult;
99916+
return validIdentifierResult;
9991799917
switch (kind) {
9991899918
case 3 /* MemberLike */:
9991999919
return undefined;
@@ -99926,7 +99926,7 @@ var ts;
9992699926
return name.charCodeAt(0) === 32 /* space */ ? undefined : { name: name, needsConvertPropertyAccess: true };
9992799927
case 5 /* None */:
9992899928
case 4 /* String */:
99929-
return validIdentiferResult;
99929+
return validIdentifierResult;
9993099930
default:
9993199931
ts.Debug.assertNever(kind);
9993299932
}

lib/tsserverlibrary.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -33623,7 +33623,7 @@ var ts;
3362333623
return type;
3362433624
}
3362533625
// A reserved member name starts with two underscores, but the third character cannot be an underscore
33626-
// or the @ symbol. A third underscore indicates an escaped form of an identifer that started
33626+
// or the @ symbol. A third underscore indicates an escaped form of an identifier that started
3362733627
// with at least two underscores. The @ character indicates that the name is denoted by a well known ES
3362833628
// Symbol instance.
3362933629
function isReservedMemberName(name) {
@@ -100250,9 +100250,9 @@ var ts;
100250100250
|| ts.isKnownSymbol(symbol)) {
100251100251
return undefined;
100252100252
}
100253-
var validIdentiferResult = { name: name, needsConvertPropertyAccess: false };
100253+
var validIdentifierResult = { name: name, needsConvertPropertyAccess: false };
100254100254
if (ts.isIdentifierText(name, target))
100255-
return validIdentiferResult;
100255+
return validIdentifierResult;
100256100256
switch (kind) {
100257100257
case 3 /* MemberLike */:
100258100258
return undefined;
@@ -100265,7 +100265,7 @@ var ts;
100265100265
return name.charCodeAt(0) === 32 /* space */ ? undefined : { name: name, needsConvertPropertyAccess: true };
100266100266
case 5 /* None */:
100267100267
case 4 /* String */:
100268-
return validIdentiferResult;
100268+
return validIdentifierResult;
100269100269
default:
100270100270
ts.Debug.assertNever(kind);
100271100271
}

lib/typescript.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -33614,7 +33614,7 @@ var ts;
3361433614
return type;
3361533615
}
3361633616
// A reserved member name starts with two underscores, but the third character cannot be an underscore
33617-
// or the @ symbol. A third underscore indicates an escaped form of an identifer that started
33617+
// or the @ symbol. A third underscore indicates an escaped form of an identifier that started
3361833618
// with at least two underscores. The @ character indicates that the name is denoted by a well known ES
3361933619
// Symbol instance.
3362033620
function isReservedMemberName(name) {
@@ -100241,9 +100241,9 @@ var ts;
100241100241
|| ts.isKnownSymbol(symbol)) {
100242100242
return undefined;
100243100243
}
100244-
var validIdentiferResult = { name: name, needsConvertPropertyAccess: false };
100244+
var validIdentifierResult = { name: name, needsConvertPropertyAccess: false };
100245100245
if (ts.isIdentifierText(name, target))
100246-
return validIdentiferResult;
100246+
return validIdentifierResult;
100247100247
switch (kind) {
100248100248
case 3 /* MemberLike */:
100249100249
return undefined;
@@ -100256,7 +100256,7 @@ var ts;
100256100256
return name.charCodeAt(0) === 32 /* space */ ? undefined : { name: name, needsConvertPropertyAccess: true };
100257100257
case 5 /* None */:
100258100258
case 4 /* String */:
100259-
return validIdentiferResult;
100259+
return validIdentifierResult;
100260100260
default:
100261100261
ts.Debug.assertNever(kind);
100262100262
}

lib/typescriptServices.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -33614,7 +33614,7 @@ var ts;
3361433614
return type;
3361533615
}
3361633616
// A reserved member name starts with two underscores, but the third character cannot be an underscore
33617-
// or the @ symbol. A third underscore indicates an escaped form of an identifer that started
33617+
// or the @ symbol. A third underscore indicates an escaped form of an identifier that started
3361833618
// with at least two underscores. The @ character indicates that the name is denoted by a well known ES
3361933619
// Symbol instance.
3362033620
function isReservedMemberName(name) {
@@ -100241,9 +100241,9 @@ var ts;
100241100241
|| ts.isKnownSymbol(symbol)) {
100242100242
return undefined;
100243100243
}
100244-
var validIdentiferResult = { name: name, needsConvertPropertyAccess: false };
100244+
var validIdentifierResult = { name: name, needsConvertPropertyAccess: false };
100245100245
if (ts.isIdentifierText(name, target))
100246-
return validIdentiferResult;
100246+
return validIdentifierResult;
100247100247
switch (kind) {
100248100248
case 3 /* MemberLike */:
100249100249
return undefined;
@@ -100256,7 +100256,7 @@ var ts;
100256100256
return name.charCodeAt(0) === 32 /* space */ ? undefined : { name: name, needsConvertPropertyAccess: true };
100257100257
case 5 /* None */:
100258100258
case 4 /* String */:
100259-
return validIdentiferResult;
100259+
return validIdentifierResult;
100260100260
default:
100261100261
ts.Debug.assertNever(kind);
100262100262
}

lib/typingsInstaller.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33615,7 +33615,7 @@ var ts;
3361533615
return type;
3361633616
}
3361733617
// A reserved member name starts with two underscores, but the third character cannot be an underscore
33618-
// or the @ symbol. A third underscore indicates an escaped form of an identifer that started
33618+
// or the @ symbol. A third underscore indicates an escaped form of an identifier that started
3361933619
// with at least two underscores. The @ character indicates that the name is denoted by a well known ES
3362033620
// Symbol instance.
3362133621
function isReservedMemberName(name) {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "typescript",
33
"author": "Microsoft Corp.",
44
"homepage": "https://www.typescriptlang.org/",
5-
"version": "3.4.0",
5+
"version": "3.5.0",
66
"license": "Apache-2.0",
77
"description": "TypeScript is a language for application scale JavaScript development",
88
"keywords": [

scripts/configurePrerelease.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function main(): void {
2222
}
2323

2424
const tag = args[0];
25-
if (tag !== "dev" && tag !== "insiders") {
25+
if (tag !== "dev" && tag !== "insiders" && tag !== "experimental") {
2626
throw new Error(`Unexpected tag name '${tag}'.`);
2727
}
2828

scripts/open-user-pr.ts

+22-12
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ function padNum(number: number) {
1818
}
1919

2020
const userName = process.env.GH_USERNAME;
21-
const reviewers = ["weswigham", "sandersn", "RyanCavanaugh"]
21+
const reviewers = process.env.requesting_user ? [process.env.requesting_user] : ["weswigham", "sandersn", "RyanCavanaugh"];
2222
const now = new Date();
23-
const branchName = `user-update-${now.getFullYear()}${padNum(now.getMonth())}${padNum(now.getDay())}`;
23+
const branchName = `user-update-${process.env.TARGET_FORK}-${now.getFullYear()}${padNum(now.getMonth())}${padNum(now.getDay())}${process.env.TARGET_BRANCH ? "-" + process.env.TARGET_BRANCH : ""}`;
2424
const remoteUrl = `https://${process.argv[2]}@github.com/${userName}/TypeScript.git`;
2525
runSequence([
2626
["git", ["checkout", "."]], // reset any changes
@@ -41,23 +41,33 @@ gh.pulls.create({
4141
owner: process.env.TARGET_FORK,
4242
repo: "TypeScript",
4343
maintainer_can_modify: true,
44-
title: `🤖 User test baselines have changed`,
44+
title: `🤖 User test baselines have changed` + (process.env.TARGET_BRANCH ? ` for ${process.env.TARGET_BRANCH}` : ""),
4545
head: `${userName}:${branchName}`,
46-
base: "master",
46+
base: process.env.TARGET_BRANCH || "master",
4747
body:
48-
`Please review the diff and merge if no changes are unexpected.
48+
`${process.env.source_issue ? `This test run was triggerd by a request on https://github.com/Microsoft/TypeScript/pull/${process.env.source_issue} `+"\n" : ""}Please review the diff and merge if no changes are unexpected.
4949
You can view the build log [here](https://typescript.visualstudio.com/TypeScript/_build/index?buildId=${process.env.BUILD_BUILDID}&_a=summary).
5050
5151
cc ${reviewers.map(r => "@" + r).join(" ")}`,
52-
}).then(r => {
52+
}).then(async r => {
5353
const num = r.data.number;
5454
console.log(`Pull request ${num} created.`);
55-
return gh.pulls.createReviewRequest({
56-
owner: process.env.TARGET_FORK,
57-
repo: "TypeScript",
58-
number: num,
59-
reviewers,
60-
});
55+
if (!process.env.source_issue) {
56+
await gh.pulls.createReviewRequest({
57+
owner: process.env.TARGET_FORK,
58+
repo: "TypeScript",
59+
number: num,
60+
reviewers,
61+
});
62+
}
63+
else {
64+
await gh.issues.createComment({
65+
number: +process.env.source_issue,
66+
owner: "Microsoft",
67+
repo: "TypeScript",
68+
body: `The user suite test run you requested has finished and _failed_. I've opened a [PR with the baseline diff from master](${r.data.html_url}).`
69+
});
70+
}
6171
}).then(() => {
6272
console.log(`Reviewers requested, done.`);
6373
}).catch(e => {

scripts/perf-result-post.js

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// @ts-check
2+
/// <reference lib="esnext.asynciterable" />
3+
// Must reference esnext.asynciterable lib, since octokit uses AsyncIterable internally
4+
const Octokit = require("@octokit/rest");
5+
const fs = require("fs");
6+
7+
const requester = process.env.requesting_user;
8+
const source = process.env.source_issue;
9+
const postedComment = process.env.status_comment;
10+
console.log(`Loading fragment from ${process.argv[3]}...`);
11+
const outputTableText = fs.readFileSync(process.argv[3], { encoding: "utf8" });
12+
console.log(`Fragment contents:
13+
${outputTableText}`);
14+
15+
const gh = new Octokit();
16+
gh.authenticate({
17+
type: "token",
18+
token: process.argv[2]
19+
});
20+
gh.issues.createComment({
21+
number: +source,
22+
owner: "Microsoft",
23+
repo: "TypeScript",
24+
body: `@${requester}
25+
The results of the perf run you requested are in!
26+
<details><summary> Here they are:</summary><p>
27+
${outputTableText}
28+
</p></details>`
29+
}).then(async data => {
30+
console.log(`Results posted!`);
31+
const newCommentUrl = data.data.html_url;
32+
const comment = await gh.issues.getComment({
33+
owner: "Microsoft",
34+
repo: "TypeScript",
35+
comment_id: +postedComment
36+
});
37+
const newBody = `${comment.data.body}
38+
39+
Update: [The results are in!](${newCommentUrl})`;
40+
return await gh.issues.updateComment({
41+
owner: "Microsoft",
42+
repo: "TypeScript",
43+
comment_id: +postedComment,
44+
body: newBody
45+
});
46+
}).catch(e => {
47+
console.error(e);
48+
process.exit(1);
49+
});

src/compiler/binder.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -2710,8 +2710,7 @@ namespace ts {
27102710
}
27112711
else {
27122712
const s = forEachIdentifierInEntityName(e.expression, parent, action);
2713-
if (!s || !s.exports) return Debug.fail();
2714-
return action(e.name, s.exports.get(e.name.escapedText), s);
2713+
return action(e.name, s && s.exports && s.exports.get(e.name.escapedText), s);
27152714
}
27162715
}
27172716

src/compiler/builder.ts

+4-7
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,7 @@ namespace ts {
236236
}
237237
});
238238

239-
if (oldCompilerOptions &&
240-
(oldCompilerOptions.outDir !== compilerOptions.outDir ||
241-
oldCompilerOptions.declarationDir !== compilerOptions.declarationDir ||
242-
(oldCompilerOptions.outFile || oldCompilerOptions.out) !== (compilerOptions.outFile || compilerOptions.out))) {
239+
if (oldCompilerOptions && compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) {
243240
// Add all files to affectedFilesPendingEmit since emit changed
244241
state.affectedFilesPendingEmit = concatenate(state.affectedFilesPendingEmit, newProgram.getSourceFiles().map(f => f.path));
245242
if (state.affectedFilesPendingEmitIndex === undefined) {
@@ -792,7 +789,7 @@ namespace ts {
792789
state,
793790
// When whole program is affected, do emit only once (eg when --out or --outFile is specified)
794791
// Otherwise just affected file
795-
affected.emitBuildInfo(writeFile || host.writeFile, cancellationToken),
792+
affected.emitBuildInfo(writeFile || maybeBind(host, host.writeFile), cancellationToken),
796793
affected,
797794
/*isPendingEmitFile*/ false,
798795
/*isBuildInfoEmit*/ true
@@ -820,7 +817,7 @@ namespace ts {
820817
state,
821818
// When whole program is affected, do emit only once (eg when --out or --outFile is specified)
822819
// Otherwise just affected file
823-
Debug.assertDefined(state.program).emit(affected === state.program ? undefined : affected as SourceFile, writeFile || host.writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers),
820+
Debug.assertDefined(state.program).emit(affected === state.program ? undefined : affected as SourceFile, writeFile || maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers),
824821
affected,
825822
isPendingEmitFile
826823
);
@@ -862,7 +859,7 @@ namespace ts {
862859
};
863860
}
864861
}
865-
return Debug.assertDefined(state.program).emit(targetSourceFile, writeFile || host.writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers);
862+
return Debug.assertDefined(state.program).emit(targetSourceFile, writeFile || maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers);
866863
}
867864

868865
/**

src/compiler/builderState.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ namespace ts.BuilderState {
230230

231231
// Create the reference map, and set the file infos
232232
for (const sourceFile of newProgram.getSourceFiles()) {
233-
const version = sourceFile.version;
233+
const version = Debug.assertDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set");
234234
const oldInfo = useOldState ? oldState!.fileInfos.get(sourceFile.path) : undefined;
235235
if (referencedMap) {
236236
const newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName);

0 commit comments

Comments
 (0)