Skip to content

Commit 60167a6

Browse files
committed
Merge branch 'master' into fix-conditional-param-leak
2 parents 9133ec5 + fd1e22b commit 60167a6

File tree

2,479 files changed

+177242
-112596
lines changed

Some content is hidden

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

2,479 files changed

+177242
-112596
lines changed

.dockerignore

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
node_modules
2+
.node_modules
3+
built/*
4+
test-args.txt
5+
~*.docx
6+
\#*\#
7+
.\#*
8+
src/harness/*.js
9+
src/compiler/diagnosticInformationMap.generated.ts
10+
src/compiler/diagnosticMessages.generated.json
11+
src/parser/diagnosticInformationMap.generated.ts
12+
src/parser/diagnosticMessages.generated.json
13+
rwc-report.html
14+
*.swp
15+
build.json
16+
*.actual
17+
*.config
18+
scripts/debug.bat
19+
scripts/run.bat
20+
scripts/word2md.js
21+
scripts/buildProtocol.js
22+
scripts/ior.js
23+
scripts/authors.js
24+
scripts/configurePrerelease.js
25+
scripts/open-user-pr.js
26+
scripts/open-cherry-pick-pr.js
27+
scripts/processDiagnosticMessages.d.ts
28+
scripts/processDiagnosticMessages.js
29+
scripts/produceLKG.js
30+
scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.js
31+
scripts/generateLocalizedDiagnosticMessages.js
32+
scripts/*.js.map
33+
scripts/typings/
34+
coverage/
35+
internal/
36+
**/.DS_Store
37+
.settings
38+
**/.vs
39+
.idea
40+
yarn.lock
41+
yarn-error.log
42+
.parallelperf.*
43+
.failed-tests
44+
TEST-results.xml
45+
package-lock.json
46+
tests
47+
.vscode
48+
.git

.github/ISSUE_TEMPLATE/Feature_request.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ about: Suggest an idea for this project
66

77
<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨
88
9-
Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Please read the FAQ first, especially the "Common Feature Requests" section.
9+
Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker.
10+
11+
Please help us by doing the following steps before logging an issue:
12+
* Search: https://github.com/Microsoft/TypeScript/search?type=Issues
13+
* Read the FAQ, especially the "Common Feature Requests" section: https://github.com/Microsoft/TypeScript/wiki/FAQ
1014
1115
-->
1216

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ tests/webTestServer.js.map
3434
tests/webhost/*.d.ts
3535
tests/webhost/webtsc.js
3636
tests/cases/**/*.js
37+
!tests/cases/docker/*.js/
3738
tests/cases/**/*.js.map
3839
*.config
3940
scripts/debug.bat
@@ -44,6 +45,7 @@ scripts/ior.js
4445
scripts/authors.js
4546
scripts/configurePrerelease.js
4647
scripts/open-user-pr.js
48+
scripts/open-cherry-pick-pr.js
4749
scripts/processDiagnosticMessages.d.ts
4850
scripts/processDiagnosticMessages.js
4951
scripts/produceLKG.js

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ package-lock.json
2929
yarn.lock
3030
CONTRIBUTING.md
3131
TEST-results.xml
32+
.dockerignore
33+
Dockerfile

.yarnrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--install.no-lockfile true

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# We use this dockerfile to build a packed tarfile which we import in our `docker` tests
2+
FROM node:current
3+
COPY . /typescript
4+
WORKDIR /typescript
5+
RUN npm install
6+
RUN npm i -g gulp-cli
7+
RUN gulp configure-insiders && gulp LKG && gulp clean && npm pack .

Gulpfile.js

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const generateLibs = () => {
4141
.pipe(concat(relativeTarget, { newLine: "\n\n" }))
4242
.pipe(dest("built/local"))));
4343
};
44-
task("lib", generateLibs)
44+
task("lib", generateLibs);
4545
task("lib").description = "Builds the library targets";
4646

4747
const cleanLib = () => del(libs.map(lib => lib.target));
@@ -168,7 +168,7 @@ task("services", series(preBuild, buildServices));
168168
task("services").description = "Builds the language service";
169169
task("services").flags = {
170170
" --built": "Compile using the built version of the compiler."
171-
}
171+
};
172172

173173
const cleanServices = async () => {
174174
if (fs.existsSync("built/local/typescriptServices.tsconfig.json")) {
@@ -200,14 +200,14 @@ task("watch-services", series(preBuild, parallel(watchLib, watchDiagnostics, wat
200200
task("watch-services").description = "Watches for changes and rebuild language service only";
201201
task("watch-services").flags = {
202202
" --built": "Compile using the built version of the compiler."
203-
}
203+
};
204204

205205
const buildServer = () => buildProject("src/tsserver", cmdLineOptions);
206206
task("tsserver", series(preBuild, buildServer));
207207
task("tsserver").description = "Builds the language server";
208208
task("tsserver").flags = {
209209
" --built": "Compile using the built version of the compiler."
210-
}
210+
};
211211

212212
const cleanServer = () => cleanProject("src/tsserver");
213213
cleanTasks.push(cleanServer);
@@ -219,13 +219,13 @@ task("watch-tsserver", series(preBuild, parallel(watchLib, watchDiagnostics, wat
219219
task("watch-tsserver").description = "Watch for changes and rebuild the language server only";
220220
task("watch-tsserver").flags = {
221221
" --built": "Compile using the built version of the compiler."
222-
}
222+
};
223223

224224
task("min", series(preBuild, parallel(buildTsc, buildServer)));
225225
task("min").description = "Builds only tsc and tsserver";
226226
task("min").flags = {
227227
" --built": "Compile using the built version of the compiler."
228-
}
228+
};
229229

230230
task("clean-min", series(cleanTsc, cleanServer));
231231
task("clean-min").description = "Cleans outputs for tsc and tsserver";
@@ -234,7 +234,7 @@ task("watch-min", series(preBuild, parallel(watchLib, watchDiagnostics, watchTsc
234234
task("watch-min").description = "Watches for changes to a tsc and tsserver only";
235235
task("watch-min").flags = {
236236
" --built": "Compile using the built version of the compiler."
237-
}
237+
};
238238

239239
const buildLssl = (() => {
240240
// build tsserverlibrary.out.js
@@ -268,7 +268,7 @@ task("lssl", series(preBuild, buildLssl));
268268
task("lssl").description = "Builds language service server library";
269269
task("lssl").flags = {
270270
" --built": "Compile using the built version of the compiler."
271-
}
271+
};
272272

273273
const cleanLssl = async () => {
274274
if (fs.existsSync("built/local/tsserverlibrary.tsconfig.json")) {
@@ -302,14 +302,14 @@ task("watch-lssl", series(preBuild, parallel(watchLib, watchDiagnostics, watchLs
302302
task("watch-lssl").description = "Watch for changes and rebuild tsserverlibrary only";
303303
task("watch-lssl").flags = {
304304
" --built": "Compile using the built version of the compiler."
305-
}
305+
};
306306

307307
const buildTests = () => buildProject("src/testRunner");
308308
task("tests", series(preBuild, parallel(buildLssl, buildTests)));
309309
task("tests").description = "Builds the test infrastructure";
310310
task("tests").flags = {
311311
" --built": "Compile using the built version of the compiler."
312-
}
312+
};
313313

314314
const cleanTests = () => cleanProject("src/testRunner");
315315
cleanTasks.push(cleanTests);
@@ -381,13 +381,13 @@ task("local", series(buildFoldStart, preBuild, parallel(localize, buildTsc, buil
381381
task("local").description = "Builds the full compiler and services";
382382
task("local").flags = {
383383
" --built": "Compile using the built version of the compiler."
384-
}
384+
};
385385

386386
task("watch-local", series(preBuild, parallel(watchLib, watchDiagnostics, watchTsc, watchServices, watchServer, watchLssl)));
387387
task("watch-local").description = "Watches for changes to projects in src/ (but does not execute tests).";
388388
task("watch-local").flags = {
389389
" --built": "Compile using the built version of the compiler."
390-
}
390+
};
391391

392392
const generateCodeCoverage = () => exec("istanbul", ["cover", "node_modules/mocha/bin/_mocha", "--", "-R", "min", "-t", "" + cmdLineOptions.testTimeout, "built/local/run.js"]);
393393
task("generate-code-coverage", series(preBuild, buildTests, generateCodeCoverage));
@@ -415,7 +415,9 @@ 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-
}
418+
" --shards": "Total number of shards running tests (default: 1)",
419+
" --shardId": "1-based ID of this shard (default: 1)",
420+
};
419421

420422
const runTestsParallel = () => runConsoleTests("built/local/run.js", "min", /*runInParallel*/ true, /*watchMode*/ false);
421423
task("runtests-parallel", series(preBuild, preTest, runTestsParallel, postTest));
@@ -429,12 +431,15 @@ task("runtests-parallel").flags = {
429431
" --workers=<number>": "The number of parallel workers to use.",
430432
" --timeout=<ms>": "Overrides the default test timeout.",
431433
" --built": "Compile using the built version of the compiler.",
434+
" --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)",
432437
};
433438

434-
task("diff", () => exec(getDiffTool(), [refBaseline, localBaseline], { ignoreExitCode: true }));
439+
task("diff", () => exec(getDiffTool(), [refBaseline, localBaseline], { ignoreExitCode: true, waitForExit: false }));
435440
task("diff").description = "Diffs the compiler baselines using the diff tool specified by the 'DIFF' environment variable";
436441

437-
task("diff-rwc", () => exec(getDiffTool(), [refRwcBaseline, localRwcBaseline], { ignoreExitCode: true }));
442+
task("diff-rwc", () => exec(getDiffTool(), [refRwcBaseline, localRwcBaseline], { ignoreExitCode: true, waitForExit: false }));
438443
task("diff-rwc").description = "Diffs the RWC baselines using the diff tool specified by the 'DIFF' environment variable";
439444

440445
/**
@@ -473,7 +478,7 @@ task("tsc-instrumented", series(lkgPreBuild, parallel(localize, buildTsc, buildS
473478
task("tsc-instrumented").description = "Builds an instrumented tsc.js";
474479
task("tsc-instrumented").flags = {
475480
"-t --tests=<testname>": "The test to run."
476-
}
481+
};
477482

478483
// TODO(rbuckton): Determine if we still need this task. Depending on a relative
479484
// path here seems like a bad idea.
@@ -528,7 +533,7 @@ task("LKG", series(lkgPreBuild, parallel(localize, buildTsc, buildServer, buildS
528533
task("LKG").description = "Makes a new LKG out of the built js files";
529534
task("LKG").flags = {
530535
" --built": "Compile using the built version of the compiler.",
531-
}
536+
};
532537

533538
const generateSpec = () => exec("cscript", ["//nologo", "scripts/word2md.js", path.resolve("doc/TypeScript Language Specification.docx"), path.resolve("doc/spec.md")]);
534539
task("generate-spec", series(buildScripts, generateSpec));
@@ -537,15 +542,15 @@ task("generate-spec").description = "Generates a Markdown version of the Languag
537542
task("clean", series(parallel(cleanTasks), cleanBuilt));
538543
task("clean").description = "Cleans build outputs";
539544

540-
const configureNightly = () => exec(process.execPath, ["scripts/configurePrerelease.js", "dev", "package.json", "src/compiler/core.ts"])
545+
const configureNightly = () => exec(process.execPath, ["scripts/configurePrerelease.js", "dev", "package.json", "src/compiler/core.ts"]);
541546
task("configure-nightly", series(buildScripts, configureNightly));
542547
task("configure-nightly").description = "Runs scripts/configurePrerelease.ts to prepare a build for nightly publishing";
543548

544-
const configureInsiders = () => exec(process.execPath, ["scripts/configurePrerelease.js", "insiders", "package.json", "src/compiler/core.ts"])
549+
const configureInsiders = () => exec(process.execPath, ["scripts/configurePrerelease.js", "insiders", "package.json", "src/compiler/core.ts"]);
545550
task("configure-insiders", series(buildScripts, configureInsiders));
546551
task("configure-insiders").description = "Runs scripts/configurePrerelease.ts to prepare a build for insiders publishing";
547552

548-
const configureExperimental = () => exec(process.execPath, ["scripts/configurePrerelease.js", "experimental", "package.json", "src/compiler/core.ts"])
553+
const configureExperimental = () => exec(process.execPath, ["scripts/configurePrerelease.js", "experimental", "package.json", "src/compiler/core.ts"]);
549554
task("configure-experimental", series(buildScripts, configureExperimental));
550555
task("configure-experimental").description = "Runs scripts/configurePrerelease.ts to prepare a build for experimental publishing";
551556

README.md

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
# TypeScript
33

4-
[![Join the chat at https://gitter.im/Microsoft/TypeScript](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Microsoft/TypeScript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
5-
[![Build Status](https://travis-ci.org/microsoft/TypeScript.svg?branch=master)](https://travis-ci.org/Microsoft/TypeScript)
4+
[![Join the chat at https://gitter.im/microsoft/TypeScript](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/microsoft/TypeScript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
5+
[![Build Status](https://travis-ci.org/microsoft/TypeScript.svg?branch=master)](https://travis-ci.org/microsoft/TypeScript)
66
[![VSTS Build Status](https://dev.azure.com/typescript/TypeScript/_apis/build/status/Typescript/node10)](https://dev.azure.com/typescript/TypeScript/_build/latest?definitionId=4&view=logs)
77
[![npm version](https://badge.fury.io/js/typescript.svg)](https://www.npmjs.com/package/typescript)
88
[![Downloads](https://img.shields.io/npm/dm/typescript.svg)](https://www.npmjs.com/package/typescript)
@@ -27,14 +27,14 @@ npm install -g typescript@next
2727

2828
## Contribute
2929

30-
There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript.
31-
* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
32-
* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls).
30+
There are many ways to [contribute](https://github.com/microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript.
31+
* [Submit bugs](https://github.com/microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
32+
* Review the [source code changes](https://github.com/microsoft/TypeScript/pulls).
3333
* Engage with other TypeScript users and developers on [StackOverflow](https://stackoverflow.com/questions/tagged/typescript).
3434
* Join the [#typescript](https://twitter.com/search?q=%23TypeScript) discussion on Twitter.
35-
* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md).
36-
* Read the language specification ([docx](https://github.com/Microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.docx?raw=true),
37-
[pdf](https://github.com/Microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.pdf?raw=true), [md](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md)).
35+
* [Contribute bug fixes](https://github.com/microsoft/TypeScript/blob/master/CONTRIBUTING.md).
36+
* Read the language specification ([docx](https://github.com/microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.docx?raw=true),
37+
[pdf](https://github.com/microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.pdf?raw=true), [md](https://github.com/microsoft/TypeScript/blob/master/doc/spec.md)).
3838

3939
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see
4040
the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com)
@@ -44,7 +44,7 @@ with any additional questions or comments.
4444

4545
* [Quick tutorial](https://www.typescriptlang.org/docs/tutorial.html)
4646
* [Programming handbook](https://www.typescriptlang.org/docs/handbook/basic-types.html)
47-
* [Language specification](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md)
47+
* [Language specification](https://github.com/microsoft/TypeScript/blob/master/doc/spec.md)
4848
* [Homepage](https://www.typescriptlang.org/)
4949

5050
## Building
@@ -54,7 +54,7 @@ In order to build the TypeScript compiler, ensure that you have [Git](https://gi
5454
Clone a copy of the repo:
5555

5656
```bash
57-
git clone https://github.com/Microsoft/TypeScript.git
57+
git clone https://github.com/microsoft/TypeScript.git
5858
```
5959

6060
Change to the TypeScript directory:
@@ -73,17 +73,25 @@ npm install
7373
Use one of the following to build and test:
7474

7575
```
76-
gulp local # Build the compiler into built/local
77-
gulp clean # Delete the built compiler
78-
gulp LKG # Replace the last known good with the built one.
79-
# Bootstrapping step to be executed when the built compiler reaches a stable state.
80-
gulp tests # Build the test infrastructure using the built compiler.
81-
gulp runtests # Run tests using the built compiler and test infrastructure.
82-
# You can override the host or specify a test for this command.
83-
# Use --host=<hostName> or --tests=<testPath>.
84-
gulp baseline-accept # This replaces the baseline test results with the results obtained from gulp runtests.
85-
gulp lint # Runs tslint on the TypeScript source.
86-
gulp help # List the above commands.
76+
gulp local # Build the compiler into built/local.
77+
gulp clean # Delete the built compiler.
78+
gulp LKG # Replace the last known good with the built one.
79+
# Bootstrapping step to be executed when the built compiler reaches a stable state.
80+
gulp tests # Build the test infrastructure using the built compiler.
81+
gulp runtests # Run tests using the built compiler and test infrastructure.
82+
# Some low-value tests are skipped when not on a CI machine - you can use the
83+
# --skipPercent=0 command to override this behavior and run all tests locally.
84+
# You can override the specific suite runner used or specify a test for this command.
85+
# Use --tests=<testPath> for a specific test and/or --runner=<runnerName> for a specific suite.
86+
# Valid runners include conformance, compiler, fourslash, project, user, and docker
87+
# The user and docker runners are extended test suite runners - the user runner
88+
# works on disk in the tests/cases/user directory, while the docker runner works in containers.
89+
# You'll need to have the docker executable in your system path for the docker runner to work.
90+
gulp runtests-parallel # Like runtests, but split across multiple threads. Uses a number of threads equal to the system
91+
# core count by default. Use --workers=<number> to adjust this.
92+
gulp baseline-accept # This replaces the baseline test results with the results obtained from gulp runtests.
93+
gulp lint # Runs tslint on the TypeScript source.
94+
gulp help # List the above commands.
8795
```
8896

8997

@@ -96,4 +104,4 @@ node built/local/tsc.js hello.ts
96104

97105
## Roadmap
98106

99-
For details on our planned features and future direction please refer to our [roadmap](https://github.com/Microsoft/TypeScript/wiki/Roadmap).
107+
For details on our planned features and future direction please refer to our [roadmap](https://github.com/microsoft/TypeScript/wiki/Roadmap).

0 commit comments

Comments
 (0)