Skip to content

Commit 540706e

Browse files
author
Andy Hanson
committed
Merge branch 'master' into convertToEsModule
2 parents 4df53c1 + fed34cd commit 540706e

File tree

1,268 files changed

+190289
-88409
lines changed

Some content is hidden

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

1,268 files changed

+190289
-88409
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ internal/
5858
!tests/baselines/reference/project/nodeModules*/**/*
5959
.idea
6060
yarn.lock
61+
yarn-error.log
6162
.parallelperf.*
6263
tests/cases/user/*/package-lock.json
6364
tests/cases/user/*/node_modules/

.gitmodules

-5
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,19 @@
22
path = tests/cases/user/TypeScript-React-Starter/TypeScript-React-Starter
33
url = https://github.com/Microsoft/TypeScript-React-Starter
44
ignore = all
5-
shallow = true
65
[submodule "tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter"]
76
path = tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter
87
url = https://github.com/Microsoft/TypeScript-Node-Starter.git
98
ignore = all
10-
shallow = true
119
[submodule "tests/cases/user/TypeScript-React-Native-Starter/TypeScript-React-Native-Starter"]
1210
path = tests/cases/user/TypeScript-React-Native-Starter/TypeScript-React-Native-Starter
1311
url = https://github.com/Microsoft/TypeScript-React-Native-Starter.git
1412
ignore = all
15-
shallow = true
1613
[submodule "tests/cases/user/TypeScript-Vue-Starter/TypeScript-Vue-Starter"]
1714
path = tests/cases/user/TypeScript-Vue-Starter/TypeScript-Vue-Starter
1815
url = https://github.com/Microsoft/TypeScript-Vue-Starter.git
1916
ignore = all
20-
shallow = true
2117
[submodule "tests/cases/user/TypeScript-WeChat-Starter/TypeScript-WeChat-Starter"]
2218
path = tests/cases/user/TypeScript-WeChat-Starter/TypeScript-WeChat-Starter
2319
url = https://github.com/Microsoft/TypeScript-WeChat-Starter.git
2420
ignore = all
25-
shallow = true

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ branches:
1818
- master
1919
- release-2.5
2020
- release-2.6
21+
- release-2.7
2122

2223
install:
2324
- npm uninstall typescript --no-save

CONTRIBUTING.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@ Issues that ask questions answered in the FAQ will be closed without elaboration
88

99
## 2. Search for Duplicates
1010

11-
[Search the existing issues](https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&q=is%3Aissue) before logging a new one.
11+
[Search the existing issues](https://github.com/Microsoft/TypeScript/search?type=Issues) before logging a new one.
12+
13+
Some search tips:
14+
* *Don't* restrict your search to only open issues. An issue with a title similar to yours may have been closed as a duplicate of one with a less-findable title.
15+
* Check for synonyms. For example, if your bug involves an interface, it likely also occurs with type aliases or classes.
16+
* Search for the title of the issue you're about to log. This sounds obvious but 80% of the time this is sufficient to find a duplicate when one exists.
17+
* Read more than the first page of results. Many bugs here use the same words so relevancy sorting is not particularly strong.
18+
* If you have a crash, search for the first few topmost function names shown in the call stack.
1219

1320
## 3. Do you have a question?
1421

@@ -183,3 +190,10 @@ jake baseline-accept
183190
```
184191

185192
to establish the new baselines as the desired behavior. This will change the files in `tests\baselines\reference`, which should be included as part of your commit. It's important to carefully validate changes in the baselines.
193+
194+
## Localization
195+
196+
All strings the user may see are stored in [`diagnosticMessages.json`](./src/compiler/diagnosticMessages.json).
197+
If you make changes to it, run `jake generate-diagnostics` to push them to the `Diagnostic` interface in [`diagnosticInformationMap.generated.ts`](./src/compiler/diagnosticInformationMap.generated.ts).
198+
199+
See [coding guidelines on diagnostic messages](https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines#diagnostic-messages).

Gulpfile.ts

+25-8
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,14 @@ const es2017LibrarySource = [
145145
const es2017LibrarySourceMap = es2017LibrarySource.map(source =>
146146
({ target: "lib." + source, sources: ["header.d.ts", source] }));
147147

148+
const es2018LibrarySource = [];
149+
const es2018LibrarySourceMap = es2018LibrarySource.map(source =>
150+
({ target: "lib." + source, sources: ["header.d.ts", source] }));
151+
148152
const esnextLibrarySource = [
149-
"esnext.asynciterable.d.ts"
153+
"esnext.asynciterable.d.ts",
154+
"esnext.array.d.ts",
155+
"esnext.promise.d.ts"
150156
];
151157

152158
const esnextLibrarySourceMap = esnextLibrarySource.map(source =>
@@ -166,15 +172,17 @@ const librarySourceMap = [
166172
{ target: "lib.es2015.d.ts", sources: ["header.d.ts", "es2015.d.ts"] },
167173
{ target: "lib.es2016.d.ts", sources: ["header.d.ts", "es2016.d.ts"] },
168174
{ target: "lib.es2017.d.ts", sources: ["header.d.ts", "es2017.d.ts"] },
175+
{ target: "lib.es2018.d.ts", sources: ["header.d.ts", "es2018.d.ts"] },
169176
{ target: "lib.esnext.d.ts", sources: ["header.d.ts", "esnext.d.ts"] },
170177

171178
// JavaScript + all host library
172179
{ target: "lib.d.ts", sources: ["header.d.ts", "es5.d.ts"].concat(hostsLibrarySources) },
173180
{ target: "lib.es6.d.ts", sources: ["header.d.ts", "es5.d.ts"].concat(es2015LibrarySources, hostsLibrarySources, "dom.iterable.d.ts") },
174181
{ target: "lib.es2016.full.d.ts", sources: ["header.d.ts", "es2016.d.ts"].concat(hostsLibrarySources, "dom.iterable.d.ts") },
175182
{ target: "lib.es2017.full.d.ts", sources: ["header.d.ts", "es2017.d.ts"].concat(hostsLibrarySources, "dom.iterable.d.ts") },
183+
{ target: "lib.es2018.full.d.ts", sources: ["header.d.ts", "es2018.d.ts"].concat(hostsLibrarySources, "dom.iterable.d.ts") },
176184
{ target: "lib.esnext.full.d.ts", sources: ["header.d.ts", "esnext.d.ts"].concat(hostsLibrarySources, "dom.iterable.d.ts") },
177-
].concat(es2015LibrarySourceMap, es2016LibrarySourceMap, es2017LibrarySourceMap, esnextLibrarySourceMap);
185+
].concat(es2015LibrarySourceMap, es2016LibrarySourceMap, es2017LibrarySourceMap, es2018LibrarySourceMap, esnextLibrarySourceMap);
178186

179187
const libraryTargets = librarySourceMap.map(f =>
180188
path.join(builtLocalDirectory, f.target));
@@ -673,14 +681,14 @@ function runConsoleTests(defaultReporter: string, runInParallel: boolean, done:
673681
workerCount = cmdLineOptions.workers;
674682
}
675683

676-
if (tests || runners || light || taskConfigsFolder) {
677-
writeTestConfigFile(tests, runners, light, taskConfigsFolder, workerCount, stackTraceLimit);
678-
}
679-
680684
if (tests && tests.toLocaleLowerCase() === "rwc") {
681685
testTimeout = 400000;
682686
}
683687

688+
if (tests || runners || light || testTimeout || taskConfigsFolder) {
689+
writeTestConfigFile(tests, runners, light, taskConfigsFolder, workerCount, stackTraceLimit, testTimeout);
690+
}
691+
684692
const colors = cmdLineOptions.colors;
685693
const reporter = cmdLineOptions.reporter || defaultReporter;
686694

@@ -865,8 +873,17 @@ function cleanTestDirs(done: (e?: any) => void) {
865873
}
866874

867875
// used to pass data from jake command line directly to run.js
868-
function writeTestConfigFile(tests: string, runners: string, light: boolean, taskConfigsFolder?: string, workerCount?: number, stackTraceLimit?: string) {
869-
const testConfigContents = JSON.stringify({ test: tests ? [tests] : undefined, runner: runners ? runners.split(",") : undefined, light, workerCount, stackTraceLimit, taskConfigsFolder, noColor: !cmdLineOptions.colors });
876+
function writeTestConfigFile(tests: string, runners: string, light: boolean, taskConfigsFolder?: string, workerCount?: number, stackTraceLimit?: string, timeout?: number) {
877+
const testConfigContents = JSON.stringify({
878+
test: tests ? [tests] : undefined,
879+
runner: runners ? runners.split(",") : undefined,
880+
light,
881+
workerCount,
882+
stackTraceLimit,
883+
taskConfigsFolder,
884+
noColor: !cmdLineOptions.colors,
885+
timeout,
886+
});
870887
console.log("Running tests with config: " + testConfigContents);
871888
fs.writeFileSync("test.config", testConfigContents);
872889
}

Jakefile.js

+21-8
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ var harnessSources = harnessCoreSources.concat([
130130
"textStorage.ts",
131131
"moduleResolution.ts",
132132
"tsconfigParsing.ts",
133+
"asserts.ts",
133134
"builder.ts",
134135
"commandLineParsing.ts",
135136
"configurationExtension.ts",
@@ -205,8 +206,16 @@ var es2017LibrarySourceMap = es2017LibrarySource.map(function (source) {
205206
return { target: "lib." + source, sources: ["header.d.ts", source] };
206207
});
207208

209+
var es2018LibrarySource = [];
210+
211+
var es2018LibrarySourceMap = es2018LibrarySource.map(function (source) {
212+
return { target: "lib." + source, sources: ["header.d.ts", source] };
213+
});
214+
208215
var esnextLibrarySource = [
209-
"esnext.asynciterable.d.ts"
216+
"esnext.asynciterable.d.ts",
217+
"esnext.array.d.ts",
218+
"esnext.promise.d.ts"
210219
];
211220

212221
var esnextLibrarySourceMap = esnextLibrarySource.map(function (source) {
@@ -227,15 +236,17 @@ var librarySourceMap = [
227236
{ target: "lib.es2015.d.ts", sources: ["header.d.ts", "es2015.d.ts"] },
228237
{ target: "lib.es2016.d.ts", sources: ["header.d.ts", "es2016.d.ts"] },
229238
{ target: "lib.es2017.d.ts", sources: ["header.d.ts", "es2017.d.ts"] },
239+
{ target: "lib.es2018.d.ts", sources: ["header.d.ts", "es2018.d.ts"] },
230240
{ target: "lib.esnext.d.ts", sources: ["header.d.ts", "esnext.d.ts"] },
231241

232242
// JavaScript + all host library
233243
{ target: "lib.d.ts", sources: ["header.d.ts", "es5.d.ts"].concat(hostsLibrarySources) },
234244
{ target: "lib.es6.d.ts", sources: ["header.d.ts", "es5.d.ts"].concat(es2015LibrarySources, hostsLibrarySources, "dom.iterable.d.ts") },
235245
{ target: "lib.es2016.full.d.ts", sources: ["header.d.ts", "es2016.d.ts"].concat(hostsLibrarySources, "dom.iterable.d.ts") },
236246
{ target: "lib.es2017.full.d.ts", sources: ["header.d.ts", "es2017.d.ts"].concat(hostsLibrarySources, "dom.iterable.d.ts") },
247+
{ target: "lib.es2018.full.d.ts", sources: ["header.d.ts", "es2018.d.ts"].concat(hostsLibrarySources, "dom.iterable.d.ts") },
237248
{ target: "lib.esnext.full.d.ts", sources: ["header.d.ts", "esnext.d.ts"].concat(hostsLibrarySources, "dom.iterable.d.ts") },
238-
].concat(es2015LibrarySourceMap, es2016LibrarySourceMap, es2017LibrarySourceMap, esnextLibrarySourceMap);
249+
].concat(es2015LibrarySourceMap, es2016LibrarySourceMap, es2017LibrarySourceMap, es2018LibrarySourceMap, esnextLibrarySourceMap);
239250

240251
var libraryTargets = librarySourceMap.map(function (f) {
241252
return path.join(builtLocalDirectory, f.target);
@@ -848,15 +859,16 @@ function cleanTestDirs() {
848859
}
849860

850861
// used to pass data from jake command line directly to run.js
851-
function writeTestConfigFile(tests, runners, light, taskConfigsFolder, workerCount, stackTraceLimit, colors) {
862+
function writeTestConfigFile(tests, runners, light, taskConfigsFolder, workerCount, stackTraceLimit, colors, testTimeout) {
852863
var testConfigContents = JSON.stringify({
853864
runners: runners ? runners.split(",") : undefined,
854865
test: tests ? [tests] : undefined,
855866
light: light,
856867
workerCount: workerCount,
857868
taskConfigsFolder: taskConfigsFolder,
858869
stackTraceLimit: stackTraceLimit,
859-
noColor: !colors
870+
noColor: !colors,
871+
timeout: testTimeout
860872
});
861873
fs.writeFileSync('test.config', testConfigContents);
862874
}
@@ -898,14 +910,14 @@ function runConsoleTests(defaultReporter, runInParallel) {
898910
workerCount = process.env.workerCount || process.env.p || os.cpus().length;
899911
}
900912

901-
if (tests || runners || light || taskConfigsFolder) {
902-
writeTestConfigFile(tests, runners, light, taskConfigsFolder, workerCount, stackTraceLimit, colors);
903-
}
904-
905913
if (tests && tests.toLocaleLowerCase() === "rwc") {
906914
testTimeout = 800000;
907915
}
908916

917+
if (tests || runners || light || testTimeout || taskConfigsFolder) {
918+
writeTestConfigFile(tests, runners, light, taskConfigsFolder, workerCount, stackTraceLimit, colors, testTimeout);
919+
}
920+
909921
var colorsFlag = process.env.color || process.env.colors;
910922
var colors = colorsFlag !== "false" && colorsFlag !== "0";
911923
var reporter = process.env.reporter || process.env.r || defaultReporter;
@@ -1192,6 +1204,7 @@ var tslintRules = [
11921204
"debugAssertRule",
11931205
"nextLineRule",
11941206
"noBomRule",
1207+
"noDoubleSpaceRule",
11951208
"noIncrementDecrementRule",
11961209
"noInOperatorRule",
11971210
"noTypeAssertionWhitespaceRule",

issue_template.md

+2
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@
1515
**Expected behavior:**
1616

1717
**Actual behavior:**
18+
19+
**Related:**

lib/cancellationToken.js

-2
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,3 @@ function createCancellationToken(args) {
6969
}
7070
}
7171
module.exports = createCancellationToken;
72-
73-
//# sourceMappingURL=cancellationToken.js.map

0 commit comments

Comments
 (0)