Skip to content

Commit 911c59f

Browse files
committed
Merge branch 'master' into typeof-in-switch
2 parents 5aaf1e6 + d8f736d commit 911c59f

File tree

5,206 files changed

+143252
-160193
lines changed

Some content is hidden

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

5,206 files changed

+143252
-160193
lines changed

.github/ISSUE_TEMPLATE/Bug_report.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ Please fill in the *entire* template below.
1616
-->
1717

1818
<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
19-
**TypeScript Version:** 3.0.0-dev.201xxxxx
19+
**TypeScript Version:** 3.1.0-dev.201xxxxx
2020

2121
<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
22-
**Search Terms:**
22+
**Search Terms:**
2323

2424
**Code**
2525

@@ -32,6 +32,6 @@ Please fill in the *entire* template below.
3232

3333
**Actual behavior:**
3434

35-
**Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior -->
35+
**Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior -->
3636

3737
**Related Issues:** <!-- Did you find other bugs that looked similar? -->

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,6 @@ tests/cases/user/*/**/*.d.ts
7474
!tests/cases/user/bignumber.js/
7575
!tests/cases/user/discord.js/
7676
tests/baselines/reference/dt
77-
.failed-tests
77+
.failed-tests
78+
TEST-results.xml
79+
package-lock.json

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,3 +358,4 @@ Vyacheslav Pukhanov <[email protected]>
358358
dangoo <[email protected]> # Daniel Gooss
359359
krk <[email protected]> # Kerem Kat
360360
micnic <[email protected]> # Nicu Micleușanu
361+
rflorian <[email protected]> # @rflorian

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ Jakefile.js
1919
.circleci
2020
.vscode/
2121
.parallelperf.json
22+
.mailmap
2223
test.config
2324
package-lock.json
2425
yarn.lock
2526
.github/
2627
CONTRIBUTING.md
28+
TEST-results.xml

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Design changes will not be accepted at this time. If you have a design change pr
6161

6262
You will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project's license, and that the work being submitted is under appropriate copyright.
6363

64-
Please submit a Contributor License Agreement (CLA) before submitting a pull request. You may visit https://cla.microsoft.com to sign digitally. Alternatively, download the agreement ([Microsoft Contribution License Agreement.docx](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=822190) or [Microsoft Contribution License Agreement.pdf](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=921298)), sign, scan, and email it back to <[email protected]>. Be sure to include your github user name along with the agreement. Once we have received the signed CLA, we'll review the request.
64+
Please submit a Contributor License Agreement (CLA) before submitting a pull request. You may visit https://cla.microsoft.com to sign digitally. Alternatively, download the agreement ([Microsoft Contribution License Agreement.pdf](https://opensource.microsoft.com/pdf/microsoft-contribution-license-agreement.pdf)), sign, scan, and email it back to <[email protected]>. Be sure to include your github user name along with the agreement. Once we have received the signed CLA, we'll review the request.
6565

6666
## Housekeeping
6767

Gulpfile.js

Lines changed: 57 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@ const baselineAccept = require("./scripts/build/baselineAccept");
2424
const cmdLineOptions = require("./scripts/build/options");
2525
const exec = require("./scripts/build/exec");
2626
const browserify = require("./scripts/build/browserify");
27-
const debounce = require("./scripts/build/debounce");
2827
const prepend = require("./scripts/build/prepend");
2928
const { removeSourceMaps } = require("./scripts/build/sourcemaps");
30-
const { CancelSource, CancelError } = require("./scripts/build/cancellation");
29+
const { CancellationTokenSource, CancelError, delay, Semaphore } = require("prex");
3130
const { libraryTargets, generateLibs } = require("./scripts/build/lib");
3231
const { runConsoleTests, cleanTestDirs, writeTestConfigFile, refBaseline, localBaseline, refRwcBaseline, localRwcBaseline } = require("./scripts/build/tests");
3332

@@ -534,57 +533,80 @@ gulp.task(
534533
["watch-diagnostics", "watch-lib"].concat(useCompilerDeps),
535534
() => project.watch(tsserverProject, { typescript: useCompiler }));
536535

537-
gulp.task(
538-
"watch-local",
539-
/*help*/ false,
540-
["watch-lib", "watch-tsc", "watch-services", "watch-server"]);
541-
542536
gulp.task(
543537
"watch-runner",
544538
/*help*/ false,
545539
useCompilerDeps,
546540
() => project.watch(testRunnerProject, { typescript: useCompiler }));
547541

548-
const watchPatterns = [
549-
runJs,
550-
typescriptDts,
551-
tsserverlibraryDts
552-
];
542+
gulp.task(
543+
"watch-local",
544+
"Watches for changes to projects in src/ (but does not execute tests).",
545+
["watch-lib", "watch-tsc", "watch-services", "watch-server", "watch-runner", "watch-lssl"]);
553546

554547
gulp.task(
555548
"watch",
556-
"Watches for changes to the build inputs for built/local/run.js, then executes runtests-parallel.",
549+
"Watches for changes to the build inputs for built/local/run.js, then runs tests.",
557550
["build-rules", "watch-runner", "watch-services", "watch-lssl"],
558551
() => {
559-
/** @type {CancelSource | undefined} */
560-
let runTestsSource;
552+
const sem = new Semaphore(1);
561553

562-
const fn = debounce(() => {
563-
runTests().catch(error => {
564-
if (error instanceof CancelError) {
565-
log.warn("Operation was canceled");
566-
}
567-
else {
568-
log.error(error);
569-
}
570-
});
571-
}, /*timeout*/ 100, { max: 500 });
572-
573-
gulp.watch(watchPatterns, () => project.wait().then(fn));
554+
gulp.watch([runJs, typescriptDts, tsserverlibraryDts], () => {
555+
runTests();
556+
});
574557

575558
// NOTE: gulp.watch is far too slow when watching tests/cases/**/* as it first enumerates *every* file
576559
const testFilePattern = /(\.ts|[\\/]tsconfig\.json)$/;
577560
fs.watch("tests/cases", { recursive: true }, (_, file) => {
578-
if (testFilePattern.test(file)) project.wait().then(fn);
561+
if (testFilePattern.test(file)) runTests();
579562
});
580563

581-
function runTests() {
582-
if (runTestsSource) runTestsSource.cancel();
583-
runTestsSource = new CancelSource();
584-
return cmdLineOptions.tests || cmdLineOptions.failed
585-
? runConsoleTests(runJs, "mocha-fivemat-progress-reporter", /*runInParallel*/ false, /*watchMode*/ true, runTestsSource.token)
586-
: runConsoleTests(runJs, "min", /*runInParallel*/ true, /*watchMode*/ true, runTestsSource.token);
587-
}
564+
async function runTests() {
565+
try {
566+
// Ensure only one instance of the test runner is running at any given time.
567+
if (sem.count > 0) {
568+
await sem.wait();
569+
try {
570+
// Wait for any concurrent recompilations to complete...
571+
try {
572+
await delay(100);
573+
while (project.hasRemainingWork()) {
574+
await project.waitForWorkToComplete();
575+
await delay(500);
576+
}
577+
}
578+
catch (e) {
579+
if (e instanceof CancelError) return;
580+
throw e;
581+
}
582+
583+
// cancel any pending or active test run if a new recompilation is triggered
584+
const source = new CancellationTokenSource();
585+
project.waitForWorkToStart().then(() => {
586+
source.cancel();
587+
});
588+
589+
if (cmdLineOptions.tests || cmdLineOptions.failed) {
590+
await runConsoleTests(runJs, "mocha-fivemat-progress-reporter", /*runInParallel*/ false, /*watchMode*/ true, source.token);
591+
}
592+
else {
593+
await runConsoleTests(runJs, "min", /*runInParallel*/ true, /*watchMode*/ true, source.token);
594+
}
595+
}
596+
finally {
597+
sem.release();
598+
}
599+
}
600+
}
601+
catch (e) {
602+
if (e instanceof CancelError) {
603+
log.warn("Operation was canceled");
604+
}
605+
else {
606+
log.error(e);
607+
}
608+
}
609+
};
588610
});
589611

590612
gulp.task("clean-built", /*help*/ false, [`clean:${diagnosticInformationMapTs}`], () => del(["built"]));

Jakefile.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ const TaskNames = {
5151
configureInsiders: "configure-insiders",
5252
publishInsiders: "publish-insiders",
5353
configureNightly: "configure-nightly",
54-
publishNightly: "publish-nightly"
54+
publishNightly: "publish-nightly",
55+
help: "help"
5556
};
5657

5758
const Paths = {};
@@ -258,6 +259,11 @@ task(TaskNames.publishNightly, [TaskNames.coreBuild, TaskNames.configureNightly,
258259
exec(cmd, () => complete());
259260
}, { async: true });
260261

262+
task(TaskNames.help, function() {
263+
var cmd = "jake --tasks";
264+
exec(cmd, () => complete());
265+
})
266+
261267
task(TaskNames.configureInsiders, [TaskNames.scripts], function () {
262268
const cmd = `${host} ${Paths.scripts.configurePrerelease} insiders ${Paths.packageJson} ${Paths.versionFile}`;
263269
exec(cmd, () => complete());
@@ -817,7 +823,7 @@ function diagnosticsToString(diagnostics, pretty) {
817823
* Concatenate a list of sourceFiles to a destinationFile
818824
* @param {string} destinationFile
819825
* @param {string[]} sourceFiles
820-
* @param {string} extraContent
826+
* @param {string=} extraContent
821827
*/
822828
function concatenateFiles(destinationFile, sourceFiles, extraContent) {
823829
var temp = "temptemp";

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
[![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)
99

10-
[TypeScript](https://www.typescriptlang.org/) is a language for application-scale JavaScript. TypeScript adds optional types, classes, and modules to JavaScript. TypeScript supports tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the [playground](https://www.typescriptlang.org/play/), and stay up to date via [our blog](https://blogs.msdn.microsoft.com/typescript) and [Twitter account](https://twitter.com/typescriptlang).
10+
[TypeScript](https://www.typescriptlang.org/) is a language for application-scale JavaScript. TypeScript adds optional types to JavaScript that support tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the [playground](https://www.typescriptlang.org/play/), and stay up to date via [our blog](https://blogs.msdn.microsoft.com/typescript) and [Twitter account](https://twitter.com/typescriptlang).
1111

1212
## Installing
1313

ThirdPartyNoticeText.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,5 +164,30 @@ For purposes of this definition, the normative portions of the Specification sha
164164
I am encouraged to provide a contact from which licensing information can be obtained and other relevant licensing information. Any such information will be made publicly available.
165165
10.8. You or Your. �You,� �you,� or �your� means any person or entity who exercises copyright or patent rights granted under this Agreement, and any person that person or entity controls.
166166

167+
-------------------------------------------------------------------------------------
168+
169+
------------------- WebGL -----------------------------
170+
Copyright (c) 2018 The Khronos Group Inc.
171+
172+
Permission is hereby granted, free of charge, to any person obtaining a
173+
copy of this software and/or associated documentation files (the
174+
"Materials"), to deal in the Materials without restriction, including
175+
without limitation the rights to use, copy, modify, merge, publish,
176+
distribute, sublicense, and/or sell copies of the Materials, and to
177+
permit persons to whom the Materials are furnished to do so, subject to
178+
the following conditions:
179+
180+
The above copyright notice and this permission notice shall be included
181+
in all copies or substantial portions of the Materials.
182+
183+
THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
184+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
185+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
186+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
187+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
188+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
189+
MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
190+
------------------------------------------------------
191+
167192
------------- End of ThirdPartyNotices ------------------------------------------- */
168193

lib/de/diagnosticMessages.generated.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Eine Namespacedeklaration darf nicht vor der Klasse oder Funktion positioniert werden, mit der sie zusammengeführt wird.",
5050
"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Eine Namespacedeklaration ist nur in einem Namespace oder Modul zulässig.",
5151
"A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "Ein Import im Namespacestil kann nicht aufgerufen oder erstellt werden und verursacht zur Laufzeit einen Fehler.",
52-
"A_non_dry_build_would_build_project_0_6357": "Bei einem Build mit dem Flag \"-dry\" würde das Projekt \"{0}\" erstellt.",
53-
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "Bei einem Build mit dem Flag \"-dry\" würden die folgenden Dateien gelöscht: {0}",
52+
"A_non_dry_build_would_build_project_0_6357": "Bei einem Build ohne das Flag \"-dry\" würde das Projekt \"{0}\" erstellt.",
53+
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "Bei einem Build ohne das Flag \"-dry\" würden die folgenden Dateien gelöscht: {0}",
5454
"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Ein Parameterinitialisierer ist nur in einer Funktions- oder Konstruktorimplementierung zulässig.",
5555
"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Eine Parametereigenschaft darf nicht mithilfe eines rest-Parameters deklariert werden.",
5656
"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Eine Parametereigenschaft ist nur in einer Konstruktorimplementierung zulässig.",

0 commit comments

Comments
 (0)