Skip to content

Commit 1f16778

Browse files
committed
Merge branch 'master' into completionWithMeaning
2 parents 65a48ca + 3d8cf62 commit 1f16778

File tree

643 files changed

+18323
-4657
lines changed

Some content is hidden

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

643 files changed

+18323
-4657
lines changed

.mailmap

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,4 +248,23 @@ rdosanjh <[email protected]> # Raj Dosanjh
248248
gdh1995 <[email protected]> # Dahan Gong
249249
cedvdb <[email protected]> # @cedvdb
250250
kpreisser <[email protected]> # K. Preißer
251-
e-cloud <[email protected]> # @e-cloud
251+
e-cloud <[email protected]> # @e-cloud
252+
Andrew Casey <[email protected]> Andrew Casey <[email protected]>
253+
Andrew Stegmaier <[email protected]>
254+
Benny Neugebauer <[email protected]>
255+
Blaine Bublitz <[email protected]>
256+
Charles Pierce <[email protected]>
257+
Daniel Król <[email protected]>
258+
Diogo Franco (Kovensky) <[email protected]>
259+
Donald Pipowitch <[email protected]>
260+
Halasi Tamás <[email protected]>
261+
262+
Joe Chung <[email protected]>
263+
Kate Miháliková <[email protected]>
264+
Mohsen Azimi <[email protected]>
265+
Noel Varanda <[email protected]>
266+
Reiner Dolp <[email protected]>
267+
268+
TravCav <[email protected]> # @TravCav
269+
Vladimir Kurchatkin <[email protected]>
270+
William Orr <[email protected]>

AUTHORS.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ TypeScript is authored by:
1515
* Anders Hejlsberg
1616
* Andreas Martin
1717
* Andrej Baran
18+
* Andrew Casey
1819
* Andrew Ochsner
20+
* Andrew Stegmaier
1921
* Andrew Z Allen
2022
* András Parditka
2123
* Andy Hanson
@@ -31,14 +33,17 @@ TypeScript is authored by:
3133
* Ben Duffield
3234
* Ben Mosher
3335
* Benjamin Bock
36+
* Benny Neugebauer
3437
* Bill Ticehurst
38+
* Blaine Bublitz
3539
* Blake Embrey
3640
* @bootstraponline
3741
* Bowden Kelly
3842
* Brett Mayen
3943
* Bryan Forbes
4044
* Caitlin Potter
4145
* @cedvdb
46+
* Charles Pierce
4247
* Charly POLY
4348
* Chris Bubernak
4449
* Christophe Vidal
@@ -52,6 +57,7 @@ TypeScript is authored by:
5257
* Dan Corder
5358
* Dan Quirk
5459
* Daniel Hollocher
60+
* Daniel Król
5561
* Daniel Lehenbauer
5662
* Daniel Rosenwasser
5763
* David Kmenta
@@ -60,9 +66,11 @@ TypeScript is authored by:
6066
* David Souther
6167
* Denis Nedelyaev
6268
* Dick van den Brink
69+
* Diogo Franco (Kovensky)
6370
* Dirk Bäumer
6471
* Dirk Holtwick
6572
* Dom Chen
73+
* Donald Pipowitch
6674
* Doug Ilijev
6775
* @e-cloud
6876
* Elisée Maurer
@@ -89,12 +97,14 @@ TypeScript is authored by:
8997
* Guilherme Oenning
9098
* Guillaume Salles
9199
* Guy Bedford
100+
* Halasi Tamás
92101
* Harald Niesche
93102
* Hendrik Liebau
94103
* Herrington Darkholme
95104
* Homa Wong
96105
* Iain Monro
97106
* Igor Novozhilov
107+
* Ika
98108
* Ingvar Stepanyan
99109
* Isiah Meadows
100110
* Ivo Gabe de Wolff
@@ -111,6 +121,7 @@ TypeScript is authored by:
111121
* Jeffrey Morlan
112122
* Jesse Schalken
113123
* Jiri Tobisek
124+
* Joe Chung
114125
* Joel Day
115126
* Joey Wilson
116127
* Johannes Rieken
@@ -131,6 +142,7 @@ TypeScript is authored by:
131142
* K. Preißer
132143
* Kagami Sascha Rosylight
133144
* Kanchalai Tanglertsampan
145+
* Kate Miháliková
134146
* Keith Mashinter
135147
* Ken Howard
136148
* Kenji Imamula
@@ -159,13 +171,15 @@ TypeScript is authored by:
159171
* Mike Busyrev
160172
* Mine Starks
161173
* Mohamed Hegazy
174+
* Mohsen Azimi
162175
* Myles Megyesi
163176
* Natalie Coley
164177
* Nathan Shively-Sanders
165178
* Nathan Yee
166179
* Nicolas Henry
167180
* Nima Zahedi
168181
* Noah Chen
182+
* Noel Varanda
169183
* Noj Vek
170184
* Oleg Mihailik
171185
* Oleksandr Chekhovskyi
@@ -186,6 +200,7 @@ TypeScript is authored by:
186200
* Punya Biswal
187201
* Rado Kirov
188202
* Raj Dosanjh
203+
* Reiner Dolp
189204
* Richard Karmazín
190205
* Richard Knoll
191206
* Richard Sentino
@@ -213,6 +228,7 @@ TypeScript is authored by:
213228
* Sudheesh Singanamalla
214229
* Sébastien Arod
215230
* @T18970237136
231+
* @t_
216232
* Tarik Ozket
217233
* Tetsuharu Ohzeki
218234
* Thomas Loubiou
@@ -225,13 +241,16 @@ TypeScript is authored by:
225241
* togru
226242
* Tomas Grubliauskas
227243
* Torben Fitschen
244+
* @TravCav
228245
* TruongSinh Tran-Nguyen
229246
* Vadi Taslim
230247
* Vidar Tonaas Fauske
231248
* Viktor Zozulyak
232249
* Vilic Vane
250+
* Vladimir Kurchatkin
233251
* Vladimir Matveev
234252
* Wesley Wigham
253+
* William Orr
235254
* York Yao
236255
* @yortus
237256
* Yuichi Nukiyama

Gulpfile.ts

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,25 @@ Error.stackTraceLimit = 1000;
3939

4040
const cmdLineOptions = minimist(process.argv.slice(2), {
4141
boolean: ["debug", "inspect", "light", "colors", "lint", "soft"],
42-
string: ["browser", "tests", "host", "reporter", "stackTraceLimit"],
42+
string: ["browser", "tests", "host", "reporter", "stackTraceLimit", "timeout"],
4343
alias: {
4444
b: "browser",
45-
d: "debug",
46-
t: "tests",
47-
test: "tests",
45+
d: "debug", "debug-brk": "debug",
46+
i: "inspect", "inspect-brk": "inspect",
47+
t: "tests", test: "tests",
4848
r: "reporter",
49-
color: "colors",
50-
f: "files",
51-
file: "files",
49+
c: "colors", color: "colors",
50+
f: "files", file: "files",
5251
w: "workers",
5352
},
5453
default: {
5554
soft: false,
5655
colors: process.env.colors || process.env.color || true,
57-
debug: process.env.debug || process.env.d,
58-
inspect: process.env.inspect,
56+
debug: process.env.debug || process.env["debug-brk"] || process.env.d,
57+
inspect: process.env.inspect || process.env["inspect-brk"] || process.env.i,
5958
host: process.env.TYPESCRIPT_HOST || process.env.host || "node",
6059
browser: process.env.browser || process.env.b || "IE",
60+
timeout: process.env.timeout || 40000,
6161
tests: process.env.test || process.env.tests || process.env.t,
6262
light: process.env.light || false,
6363
reporter: process.env.reporter || process.env.r,
@@ -594,11 +594,11 @@ function restoreSavedNodeEnv() {
594594
process.env.NODE_ENV = savedNodeEnv;
595595
}
596596

597-
let testTimeout = 40000;
598597
function runConsoleTests(defaultReporter: string, runInParallel: boolean, done: (e?: any) => void) {
599598
const lintFlag = cmdLineOptions["lint"];
600599
cleanTestDirs((err) => {
601600
if (err) { console.error(err); failWithStatus(err, 1); }
601+
let testTimeout = cmdLineOptions["timeout"];
602602
const debug = cmdLineOptions["debug"];
603603
const inspect = cmdLineOptions["inspect"];
604604
const tests = cmdLineOptions["tests"];
@@ -637,12 +637,6 @@ function runConsoleTests(defaultReporter: string, runInParallel: boolean, done:
637637
// default timeout is 2sec which really should be enough, but maybe we just need a small amount longer
638638
if (!runInParallel) {
639639
const args = [];
640-
if (inspect) {
641-
args.push("--inspect");
642-
}
643-
if (inspect || debug) {
644-
args.push("--debug-brk");
645-
}
646640
args.push("-R", reporter);
647641
if (tests) {
648642
args.push("-g", `"${tests}"`);
@@ -653,7 +647,15 @@ function runConsoleTests(defaultReporter: string, runInParallel: boolean, done:
653647
else {
654648
args.push("--no-colors");
655649
}
656-
args.push("-t", testTimeout);
650+
if (inspect) {
651+
args.unshift("--inspect-brk");
652+
}
653+
else if (debug) {
654+
args.unshift("--debug-brk");
655+
}
656+
else {
657+
args.push("-t", testTimeout);
658+
}
657659
args.push(run);
658660
setNodeEnvToDevelopment();
659661
exec(mocha, args, lintThenFinish, function(e, status) {
@@ -838,6 +840,7 @@ gulp.task("runtests-browser", "Runs the tests using the built run.js file like '
838840
});
839841

840842
gulp.task("generate-code-coverage", "Generates code coverage data via istanbul", ["tests"], (done) => {
843+
const testTimeout = cmdLineOptions["timeout"];
841844
exec("istanbul", ["cover", "node_modules/mocha/bin/_mocha", "--", "-R", "min", "-t", testTimeout.toString(), run], done, done);
842845
});
843846

Jakefile.js

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ var LKGDirectory = "lib/";
2525
var copyright = "CopyrightNotice.txt";
2626
var thirdParty = "ThirdPartyNoticeText.txt";
2727

28+
var defaultTestTimeout = 40000;
29+
2830
// add node_modules to path so we don't need global modules, prefer the modules by adding them first
2931
var nodeModulesPathPrefix = path.resolve("./node_modules/.bin/") + path.delimiter;
3032
if (process.env.path !== undefined) {
@@ -74,6 +76,10 @@ function measure(marker) {
7476
console.log("travis_time:end:" + marker.id + ":start=" + toNs(marker.stamp) + ",finish=" + toNs(total) + ",duration=" + toNs(diff) + "\r");
7577
}
7678

79+
function removeConstModifierFromEnumDeclarations(text) {
80+
return text.replace(/^(\s*)(export )?const enum (\S+) {(\s*)$/gm, '$1$2enum $3 {$4');
81+
}
82+
7783
var compilerSources = filesFromConfig("./src/compiler/tsconfig.json");
7884
var servicesSources = filesFromConfig("./src/services/tsconfig.json");
7985
var cancellationTokenSources = filesFromConfig(path.join(serverDirectory, "cancellationToken/tsconfig.json"));
@@ -268,7 +274,6 @@ var builtLocalCompiler = path.join(builtLocalDirectory, compilerFilename);
268274
* @param {boolean} opts.preserveConstEnums: true if compiler should keep const enums in code
269275
* @param {boolean} opts.noResolve: true if compiler should not include non-rooted files in compilation
270276
* @param {boolean} opts.stripInternal: true if compiler should remove declarations marked as @internal
271-
* @param {boolean} opts.noMapRoot: true if compiler omit mapRoot option
272277
* @param {boolean} opts.inlineSourceMap: true if compiler should inline sourceMap
273278
* @param {Array} opts.types: array of types to include in compilation
274279
* @param callback: a function to execute after the compilation process ends
@@ -321,9 +326,6 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, opts
321326
}
322327
else {
323328
options += " -sourcemap";
324-
if (!opts.noMapRoot) {
325-
options += " -mapRoot file:///" + path.resolve(path.dirname(outFile));
326-
}
327329
}
328330
}
329331
else {
@@ -527,7 +529,7 @@ task("importDefinitelyTypedTests", [importDefinitelyTypedTestsJs], function () {
527529

528530
// Local target to build the compiler and services
529531
var tscFile = path.join(builtLocalDirectory, compilerFilename);
530-
compileFile(tscFile, compilerSources, [builtLocalDirectory, copyright].concat(compilerSources), [copyright], /*useBuiltCompiler:*/ false, { noMapRoot: true });
532+
compileFile(tscFile, compilerSources, [builtLocalDirectory, copyright].concat(compilerSources), [copyright], /*useBuiltCompiler:*/ false);
531533

532534
var servicesFile = path.join(builtLocalDirectory, "typescriptServices.js");
533535
var servicesFileInBrowserTest = path.join(builtLocalDirectory, "typescriptServicesInBrowserTest.js");
@@ -555,7 +557,7 @@ compileFile(servicesFile, servicesSources, [builtLocalDirectory, copyright].conc
555557
// Stanalone/web definition file using global 'ts' namespace
556558
jake.cpR(standaloneDefinitionsFile, nodeDefinitionsFile, { silent: true });
557559
var definitionFileContents = fs.readFileSync(nodeDefinitionsFile).toString();
558-
definitionFileContents = definitionFileContents.replace(/^(\s*)(export )?const enum (\S+) {(\s*)$/gm, '$1$2enum $3 {$4');
560+
definitionFileContents = removeConstModifierFromEnumDeclarations(definitionFileContents)
559561
fs.writeFileSync(standaloneDefinitionsFile, definitionFileContents);
560562

561563
// Official node package definition file, pointed to by 'typings' in package.json
@@ -582,7 +584,6 @@ compileFile(
582584
keepComments: true,
583585
noResolve: false,
584586
stripInternal: true,
585-
noMapRoot: true,
586587
inlineSourceMap: true
587588
});
588589

@@ -616,6 +617,7 @@ compileFile(
616617
fs.readFileSync(tsserverLibraryDefinitionFile).toString() +
617618
"\r\nexport = ts;" +
618619
"\r\nexport as namespace ts;";
620+
tsserverLibraryDefinitionFileContents = removeConstModifierFromEnumDeclarations(tsserverLibraryDefinitionFileContents);
619621

620622
fs.writeFileSync(tsserverLibraryDefinitionFile, tsserverLibraryDefinitionFileContents);
621623
});
@@ -805,9 +807,10 @@ function runConsoleTests(defaultReporter, runInParallel) {
805807
cleanTestDirs();
806808
}
807809

808-
var debug = process.env.debug || process.env.d;
809-
var inspect = process.env.inspect;
810-
tests = process.env.test || process.env.tests || process.env.t;
810+
var debug = process.env.debug || process.env["debug-brk"] || process.env.d;
811+
var inspect = process.env.inspect || process.env["inspect-brk"] || process.env.i;
812+
var testTimeout = process.env.timeout || defaultTestTimeout;
813+
var tests = process.env.test || process.env.tests || process.env.t;
811814
var light = process.env.light || false;
812815
var stackTraceLimit = process.env.stackTraceLimit;
813816
var testConfigFile = 'test.config';
@@ -825,7 +828,7 @@ function runConsoleTests(defaultReporter, runInParallel) {
825828
} while (fs.existsSync(taskConfigsFolder));
826829
fs.mkdirSync(taskConfigsFolder);
827830

828-
workerCount = process.env.workerCount || os.cpus().length;
831+
workerCount = process.env.workerCount || process.env.p || os.cpus().length;
829832
}
830833

831834
if (tests || light || taskConfigsFolder) {
@@ -846,12 +849,6 @@ function runConsoleTests(defaultReporter, runInParallel) {
846849
if (!runInParallel) {
847850
var startTime = mark();
848851
var args = [];
849-
if (inspect) {
850-
args.push("--inspect");
851-
}
852-
if (inspect || debug) {
853-
args.push("--debug-brk");
854-
}
855852
args.push("-R", reporter);
856853
if (tests) {
857854
args.push("-g", `"${tests}"`);
@@ -865,7 +862,15 @@ function runConsoleTests(defaultReporter, runInParallel) {
865862
if (bail) {
866863
args.push("--bail");
867864
}
868-
args.push("-t", testTimeout);
865+
if (inspect) {
866+
args.unshift("--inspect-brk");
867+
}
868+
else if (debug) {
869+
args.unshift("--debug-brk");
870+
}
871+
else {
872+
args.push("-t", testTimeout);
873+
}
869874
args.push(run);
870875

871876
var cmd = "mocha " + args.join(" ");
@@ -930,7 +935,6 @@ function runConsoleTests(defaultReporter, runInParallel) {
930935
}
931936
}
932937

933-
var testTimeout = 20000;
934938
desc("Runs all the tests in parallel using the built run.js file. Optional arguments are: t[ests]=category1|category2|... d[ebug]=true.");
935939
task("runtests-parallel", ["build-rules", "tests", builtLocalDirectory], function () {
936940
runConsoleTests('min', /*runInParallel*/ true);
@@ -943,6 +947,7 @@ task("runtests", ["build-rules", "tests", builtLocalDirectory], function() {
943947

944948
desc("Generates code coverage data via instanbul");
945949
task("generate-code-coverage", ["tests", builtLocalDirectory], function () {
950+
var testTimeout = process.env.timeout || defaultTestTimeout;
946951
var cmd = 'istanbul cover node_modules/mocha/bin/_mocha -- -R min -t ' + testTimeout + ' ' + run;
947952
console.log(cmd);
948953
exec(cmd);

0 commit comments

Comments
 (0)