Skip to content

Commit 4ec6fdd

Browse files
committed
Merge branch 'master' into conditionalTypes
# Conflicts: # src/compiler/checker.ts # src/compiler/types.ts # tests/baselines/reference/api/tsserverlibrary.d.ts # tests/baselines/reference/api/typescript.d.ts
2 parents d52fa71 + b363f4f commit 4ec6fdd

723 files changed

Lines changed: 17991 additions & 6500 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 1 addition & 0 deletions
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/

.mailmap

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ Mike Busyrev <busyrev@gmail.com>
140140
Mine Starks <minestarks@users.noreply.github.com> Mine Starks <mineyalc@microsoft.com>
141141
Mohamed Hegazy <mhegazy@microsoft.com>
142142
ncoley <nrcoley@gmail.com> # Natalie Coley
143-
Nathan Shively-Sanders <nathansa@microsoft.com>
143+
Nathan Shively-Sanders <nathansa@microsoft.com> Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
144144
Nathan Yee <ny.nathan.yee@gmail.com>
145145
Nima Zahedi <nima.zahedee@gmail.com>
146146
Noah Chen <nchen@palantir.com>
@@ -287,4 +287,28 @@ Stas Vilchik <stas.vilchik@sonarsource.com>
287287
Taras Mankovski <tarasm@gmail.com>
288288
Thomas den Hollander <ThomasdenH@users.noreply.github.com>
289289
Vakhurin Sergey <igelbox@gmail.com>
290-
Zeeshan Ahmed <ziishaned@gmail.com>
290+
Zeeshan Ahmed <ziishaned@gmail.com>
291+
Orta <orta.therox+github@gmail.com> # Orta Therox
292+
IdeaHunter <admin@fckn.me> # @IdeaHunter
293+
kujon <jakub.korzeniowski@gmail.com> # Jakub Korzeniowski
294+
Matt <begincalendar@users.noreply.github.com> @begincalendar
295+
meyer <github.com@meyer.fm> # @meyer
296+
micbou <contact@micbou.com> # @micbou
297+
Alan Agius <alan.agius4@gmail.com>
298+
Alex Khomchenko <akhomchenko@gmail.com>
299+
Oussama Ben Brahim <benbraou@gmail.com> benbraou <benbraou@users.noreply.github.com>
300+
Cameron Taggart <cameron.taggart@gmail.com>
301+
csigs <csigs@outlook.com> csigs <csigs@users.noreply.github.com>
302+
Eugene Timokhov <timocov@gmail.com>
303+
Kris Zyp <kriszyp@gmail.com>
304+
Jing Ma <mjingm87@qq.com>
305+
Martin Hiller <martin.hiller88@gmail.com>
306+
Mike Morearty <mmorearty@users.noreply.github.com>
307+
Priyantha Lankapura <403912+lankaapura@users.noreply.github.com>
308+
Remo H. Jansen <remo.jansen@wolksoftware.com>
309+
Sean Barag <sjbarag@gmail.com>
310+
Sharon Rolel <sharonrolel@gmail.com>
311+
Stanislav Iliev <gigobest2@gmail.com>
312+
Wenlu Wang <805037171@163.com> wenlu.wang <805037171@163.com> kingwl <805037171@163.com>
313+
Wilson Hobbs <wilsonhobbs1@gmail.com>
314+
Yuval Greenfield <ubershmekel@gmail.com>

.travis.yml

Lines changed: 1 addition & 0 deletions
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

AUTHORS.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ TypeScript is authored by:
66
* Adrian Leonhard
77
* Ahmad Farid
88
* Akshar Patel
9+
* Alan Agius
910
* Alex Chugaev
1011
* Alex Eagle
12+
* Alex Khomchenko
1113
* Alexander Kuvaev
1214
* Alexander Rusakov
1315
* Ali Sabzevari
@@ -47,6 +49,7 @@ TypeScript is authored by:
4749
* Brett Mayen
4850
* Bryan Forbes
4951
* Caitlin Potter
52+
* Cameron Taggart
5053
* @cedvdb
5154
* Charles Pierce
5255
* Charly POLY
@@ -56,6 +59,7 @@ TypeScript is authored by:
5659
* Colby Russell
5760
* Colin Snover
5861
* Cotton Hou
62+
* csigs
5963
* Cyrus Najmabadi
6064
* Dafrok Zhang
6165
* Dahan Gong
@@ -85,6 +89,7 @@ TypeScript is authored by:
8589
* Erik McClenney
8690
* Ethan Resnick
8791
* Ethan Rubio
92+
* Eugene Timokhov
8893
* Evan Martin
8994
* Evan Sebastian
9095
* Eyas Sharaiha
@@ -111,13 +116,15 @@ TypeScript is authored by:
111116
* Herrington Darkholme
112117
* Homa Wong
113118
* Iain Monro
119+
* @IdeaHunter
114120
* Igor Novozhilov
115121
* Ika
116122
* Ingvar Stepanyan
117123
* Isiah Meadows
118124
* Ivan Enderlin
119125
* Ivo Gabe de Wolff
120126
* Iwata Hidetaka
127+
* Jakub Korzeniowski
121128
* Jakub Młokosiewicz
122129
* James Henry
123130
* James Whitney
@@ -130,6 +137,7 @@ TypeScript is authored by:
130137
* Jed Mao
131138
* Jeffrey Morlan
132139
* Jesse Schalken
140+
* Jing Ma
133141
* Jiri Tobisek
134142
* Joe Calzaretta
135143
* Joe Chung
@@ -160,6 +168,7 @@ TypeScript is authored by:
160168
* Kevin Lang
161169
* Kitson Kelly
162170
* Klaus Meinhardt
171+
* Kris Zyp
163172
* Kyle Kelley
164173
* Kārlis Gaņģis
165174
* Lorant Pinter
@@ -170,19 +179,24 @@ TypeScript is authored by:
170179
* Manish Giri
171180
* Marin Marinov
172181
* Marius Schulz
182+
* Martin Hiller
173183
* Martin Vseticka
174184
* Masahiro Wakame
185+
* Matt
175186
* Matt Bierner
176187
* Matt McCutchen
177188
* Matt Mitchell
178189
* Mattias Buelens
179190
* Mattias Buelens
180191
* Max Deepfield
181192
* Maxwell Paul Brickner
193+
* @meyer
182194
* Micah Zoltu
195+
* @micbou
183196
* Michael
184197
* Michael Bromley
185198
* Mike Busyrev
199+
* Mike Morearty
186200
* Mine Starks
187201
* Mohamed Hegazy
188202
* Mohsen Azimi
@@ -198,7 +212,9 @@ TypeScript is authored by:
198212
* Oleg Mihailik
199213
* Oleksandr Chekhovskyi
200214
* Omer Sheikh
215+
* Orta Therox
201216
* Oskar Segersva¨rd
217+
* Oussama Ben Brahim
202218
* Patrick Zhong
203219
* Paul Jolly
204220
* Paul van Brenk
@@ -210,11 +226,13 @@ TypeScript is authored by:
210226
* Piero Cangianiello
211227
* @piloopin
212228
* Prayag Verma
229+
* Priyantha Lankapura
213230
* @progre
214231
* Punya Biswal
215232
* Rado Kirov
216233
* Raj Dosanjh
217234
* Reiner Dolp
235+
* Remo H. Jansen
218236
* Richard Karmazín
219237
* Richard Knoll
220238
* Richard Sentino
@@ -227,8 +245,10 @@ TypeScript is authored by:
227245
* Ryohei Ikegami
228246
* Sam El-Husseini
229247
* Sarangan Rajamanickam
248+
* Sean Barag
230249
* Sergey Rubanov
231250
* Sergey Shandar
251+
* Sharon Rolel
232252
* Sheetal Nandi
233253
* Shengping Zhong
234254
* Shyyko Serhiy
@@ -237,6 +257,7 @@ TypeScript is authored by:
237257
* Solal Pirelli
238258
* Soo Jae Hwang
239259
* Stan Thomas
260+
* Stanislav Iliev
240261
* Stanislav Sysoev
241262
* Stas Vilchik
242263
* Steve Lucco
@@ -268,11 +289,14 @@ TypeScript is authored by:
268289
* Vilic Vane
269290
* Vladimir Kurchatkin
270291
* Vladimir Matveev
292+
* Wenlu Wang
271293
* Wesley Wigham
272294
* William Orr
295+
* Wilson Hobbs
273296
* York Yao
274297
* @yortus
275298
* Yuichi Nukiyama
299+
* Yuval Greenfield
276300
* Zeeshan Ahmed
277301
* Zev Spitz
278302
* Zhengbo Li

CONTRIBUTING.md

Lines changed: 15 additions & 1 deletion
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

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ const es2018LibrarySourceMap = es2018LibrarySource.map(source =>
150150
({ target: "lib." + source, sources: ["header.d.ts", source] }));
151151

152152
const esnextLibrarySource = [
153-
"esnext.asynciterable.d.ts"
153+
"esnext.asynciterable.d.ts",
154+
"esnext.array.d.ts",
155+
"esnext.promise.d.ts"
154156
];
155157

156158
const esnextLibrarySourceMap = esnextLibrarySource.map(source =>
@@ -526,7 +528,7 @@ gulp.task(tsserverLibraryFile, /*help*/ false, [servicesFile, typesMapJson], (do
526528
const serverLibraryProject = tsc.createProject("src/server/tsconfig.library.json", getCompilerSettings({ removeComments: false }, /*useBuiltCompiler*/ true));
527529
const {js, dts}: { js: NodeJS.ReadableStream, dts: NodeJS.ReadableStream } = serverLibraryProject.src()
528530
.pipe(sourcemaps.init())
529-
.pipe(newer(tsserverLibraryFile))
531+
.pipe(newer(<any>{ dest: tsserverLibraryFile, extra: ["src/compiler/**/*.ts", "src/services/**/*.ts"] }))
530532
.pipe(serverLibraryProject());
531533

532534
return merge2([
@@ -679,14 +681,14 @@ function runConsoleTests(defaultReporter: string, runInParallel: boolean, done:
679681
workerCount = cmdLineOptions.workers;
680682
}
681683

682-
if (tests || runners || light || taskConfigsFolder) {
683-
writeTestConfigFile(tests, runners, light, taskConfigsFolder, workerCount, stackTraceLimit);
684-
}
685-
686684
if (tests && tests.toLocaleLowerCase() === "rwc") {
687685
testTimeout = 400000;
688686
}
689687

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

@@ -871,8 +873,17 @@ function cleanTestDirs(done: (e?: any) => void) {
871873
}
872874

873875
// used to pass data from jake command line directly to run.js
874-
function writeTestConfigFile(tests: string, runners: string, light: boolean, taskConfigsFolder?: string, workerCount?: number, stackTraceLimit?: string) {
875-
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+
});
876887
console.log("Running tests with config: " + testConfigContents);
877888
fs.writeFileSync("test.config", testConfigContents);
878889
}

Jakefile.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ var es2018LibrarySourceMap = es2018LibrarySource.map(function (source) {
213213
});
214214

215215
var esnextLibrarySource = [
216-
"esnext.asynciterable.d.ts"
216+
"esnext.asynciterable.d.ts",
217+
"esnext.array.d.ts",
218+
"esnext.promise.d.ts"
217219
];
218220

219221
var esnextLibrarySourceMap = esnextLibrarySource.map(function (source) {
@@ -857,15 +859,16 @@ function cleanTestDirs() {
857859
}
858860

859861
// used to pass data from jake command line directly to run.js
860-
function writeTestConfigFile(tests, runners, light, taskConfigsFolder, workerCount, stackTraceLimit, colors) {
862+
function writeTestConfigFile(tests, runners, light, taskConfigsFolder, workerCount, stackTraceLimit, colors, testTimeout) {
861863
var testConfigContents = JSON.stringify({
862864
runners: runners ? runners.split(",") : undefined,
863865
test: tests ? [tests] : undefined,
864866
light: light,
865867
workerCount: workerCount,
866868
taskConfigsFolder: taskConfigsFolder,
867869
stackTraceLimit: stackTraceLimit,
868-
noColor: !colors
870+
noColor: !colors,
871+
timeout: testTimeout
869872
});
870873
fs.writeFileSync('test.config', testConfigContents);
871874
}
@@ -907,14 +910,14 @@ function runConsoleTests(defaultReporter, runInParallel) {
907910
workerCount = process.env.workerCount || process.env.p || os.cpus().length;
908911
}
909912

910-
if (tests || runners || light || taskConfigsFolder) {
911-
writeTestConfigFile(tests, runners, light, taskConfigsFolder, workerCount, stackTraceLimit, colors);
912-
}
913-
914913
if (tests && tests.toLocaleLowerCase() === "rwc") {
915914
testTimeout = 800000;
916915
}
917916

917+
if (tests || runners || light || testTimeout || taskConfigsFolder) {
918+
writeTestConfigFile(tests, runners, light, taskConfigsFolder, workerCount, stackTraceLimit, colors, testTimeout);
919+
}
920+
918921
var colorsFlag = process.env.color || process.env.colors;
919922
var colors = colorsFlag !== "false" && colorsFlag !== "0";
920923
var reporter = process.env.reporter || process.env.r || defaultReporter;
@@ -1201,6 +1204,7 @@ var tslintRules = [
12011204
"debugAssertRule",
12021205
"nextLineRule",
12031206
"noBomRule",
1207+
"noDoubleSpaceRule",
12041208
"noIncrementDecrementRule",
12051209
"noInOperatorRule",
12061210
"noTypeAssertionWhitespaceRule",

issue_template.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@
1515
**Expected behavior:**
1616

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

0 commit comments

Comments
 (0)