Skip to content

Commit be7e0a7

Browse files
committed
Merge branch 'master' into tupleTypes
2 parents 63b83e7 + d3c70ef commit be7e0a7

File tree

4,443 files changed

+183749
-41016
lines changed

Some content is hidden

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

4,443 files changed

+183749
-41016
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
node_modules/
2-
built/
2+
built/*
33
tests/cases/*.js
44
tests/cases/*/*.js
55
tests/cases/*/*/*.js
@@ -23,6 +23,7 @@ tests/services/baselines/prototyping/local/*
2323
tests/services/browser/typescriptServices.js
2424
scripts/processDiagnosticMessages.d.ts
2525
scripts/processDiagnosticMessages.js
26+
scripts/importDefinitelyTypedTests.js
2627
src/harness/*.js
2728
rwc-report.html
2829
*.swp
@@ -35,4 +36,4 @@ tests/*.d.ts
3536
*.config
3637
scripts/debug.bat
3738
scripts/run.bat
38-
coverage/
39+
coverage/

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ To run all tests, invoke the runtests target using jake:
3232

3333
`jake runtests`
3434

35-
This will all tests; to run only a specific subset of tests, use:
35+
This run will all tests; to run only a specific subset of tests, use:
3636

3737
`jake runtests tests=<regex>`
3838

Jakefile

Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ var compilerSources = [
4343

4444
var servicesSources = [
4545
"core.ts",
46-
"sys.ts",
4746
"types.ts",
4847
"scanner.ts",
4948
"parser.ts",
@@ -71,6 +70,7 @@ var harnessSources = [
7170
"fourslashRunner.ts",
7271
"projectsRunner.ts",
7372
"unittestrunner.ts",
73+
"loggedIO.ts",
7474
"rwcRunner.ts",
7575
"runner.ts"
7676
].map(function (f) {
@@ -123,6 +123,8 @@ function concatenateFiles(destinationFile, sourceFiles) {
123123
}
124124

125125
var useDebugMode = false;
126+
var host = (process.env.host || process.env.TYPESCRIPT_HOST || "node");
127+
var compilerFilename = "tsc.js";
126128
/* Compiles a file from a list of sources
127129
* @param outFile: the target file name
128130
* @param sources: an array of the names of the source files
@@ -134,10 +136,9 @@ var useDebugMode = false;
134136
function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOutFile) {
135137
file(outFile, prereqs, function() {
136138
var dir = useBuiltCompiler ? builtLocalDirectory : LKGDirectory;
137-
var compilerFilename = "tsc.js";
138139
var options = "-removeComments --module commonjs -noImplicitAny "; //" -propagateEnumConstants "
139140

140-
var cmd = (process.env.host || process.env.TYPESCRIPT_HOST || "node") + " " + dir + compilerFilename + " " + options + " ";
141+
var cmd = host + " " + dir + compilerFilename + " " + options + " ";
141142
if (useDebugMode) {
142143
cmd = cmd + " " + path.join(harnessDirectory, "external/es5compat.ts") + " " + path.join(harnessDirectory, "external/json2.ts") + " ";
143144
}
@@ -230,7 +231,7 @@ task("generate-diagnostics", [diagnosticInfoMapTs])
230231

231232

232233
// Local target to build the compiler and services
233-
var tscFile = path.join(builtLocalDirectory, "tsc.js");
234+
var tscFile = path.join(builtLocalDirectory, compilerFilename);
234235
compileFile(tscFile, compilerSources, [builtLocalDirectory, copyright].concat(compilerSources), [copyright], /*useBuiltCompiler:*/ false);
235236

236237
var servicesFile = path.join(builtLocalDirectory, "typescriptServices.js");
@@ -312,9 +313,9 @@ function exec(cmd, completeHandler) {
312313
complete();
313314
});
314315
ex.addListener("error", function(e, status) {
315-
process.stderr.write(status);
316-
process.stderr.write(e);
317-
complete();
316+
process.stderr.write(status);
317+
process.stderr.write(e);
318+
complete();
318319
})
319320
try{
320321
ex.run();
@@ -360,10 +361,15 @@ task("runtests", ["tests", builtLocalDirectory], function() {
360361
if(fs.existsSync(testConfigFile)) {
361362
fs.unlinkSync(testConfigFile);
362363
}
364+
363365
if(tests) {
364366
writeTestConfigFile(tests, testConfigFile);
365367
}
366368

369+
if (tests && tests.toLocaleLowerCase() === "rwc") {
370+
testTimeout = 50000;
371+
}
372+
367373
colors = process.env.colors || process.env.color
368374
colors = colors ? ' --no-colors ' : ''
369375
tests = tests ? ' -g ' + tests : '';
@@ -377,9 +383,9 @@ task("runtests", ["tests", builtLocalDirectory], function() {
377383

378384
desc("Generates code coverage data via instanbul")
379385
task("generate-code-coverage", ["tests", builtLocalDirectory], function () {
380-
var cmd = 'istanbul cover node_modules/mocha/bin/_mocha -- -R min -t ' + testTimeout + ' ' + run;
381-
console.log(cmd);
382-
exec(cmd);
386+
var cmd = 'istanbul cover node_modules/mocha/bin/_mocha -- -R min -t ' + testTimeout + ' ' + run;
387+
console.log(cmd);
388+
exec(cmd);
383389
}, { async: true });
384390

385391
// Browser tests
@@ -464,7 +470,7 @@ compileFile(webhostJsPath, [webhostPath], [tscFile, webhostPath].concat(libraryT
464470

465471
desc("Builds the tsc web host");
466472
task("webhost", [webhostJsPath], function() {
467-
jake.cpR(path.join(builtLocalDirectory, "lib.d.ts"), "tests/webhost/", {silent: true});
473+
jake.cpR(path.join(builtLocalDirectory, "lib.d.ts"), "tests/webhost/", {silent: true});
468474
});
469475

470476
// Perf compiler
@@ -473,3 +479,36 @@ var perftscJsPath = "built/local/perftsc.js";
473479
compileFile(perftscJsPath, [perftscPath], [tscFile, perftscPath, "tests/perfsys.ts"].concat(libraryTargets), [], true);
474480
desc("Builds augmented version of the compiler for perf tests");
475481
task("perftsc", [perftscJsPath]);
482+
483+
// Instrumented compiler
484+
var loggedIOpath = harnessDirectory + 'loggedIO.ts';
485+
var loggedIOJsPath = builtLocalDirectory + 'loggedIO.js';
486+
file(loggedIOJsPath, [builtLocalDirectory, loggedIOpath], function() {
487+
var temp = builtLocalDirectory + 'temp';
488+
jake.mkdirP(temp);
489+
var options = "--outdir " + temp + ' ' + loggedIOpath;
490+
var cmd = host + " " + LKGDirectory + compilerFilename + " " + options + " ";
491+
console.log(cmd + "\n");
492+
var ex = jake.createExec([cmd]);
493+
ex.addListener("cmdEnd", function() {
494+
fs.renameSync(temp + '/harness/loggedIO.js', loggedIOJsPath);
495+
jake.rmRf(temp);
496+
complete();
497+
});
498+
ex.run();
499+
}, {async: true});
500+
501+
var instrumenterPath = harnessDirectory + 'instrumenter.ts';
502+
var instrumenterJsPath = builtLocalDirectory + 'instrumenter.js';
503+
compileFile(instrumenterJsPath, [instrumenterPath], [tscFile, instrumenterPath], [], true);
504+
505+
desc("Builds an instrumented tsc.js");
506+
task('tsc-instrumented', [loggedIOJsPath, instrumenterJsPath, tscFile], function() {
507+
var cmd = host + ' ' + instrumenterJsPath + ' record iocapture ' + builtLocalDirectory + compilerFilename;
508+
console.log(cmd);
509+
var ex = jake.createExec([cmd]);
510+
ex.addListener("cmdEnd", function() {
511+
complete();
512+
});
513+
ex.run();
514+
}, { async: true });

bin/lib.core.d.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -956,11 +956,24 @@ declare var JSON: JSON;
956956
/////////////////////////////
957957

958958
interface Array<T> {
959+
/**
960+
* Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.
961+
*/
962+
length: number;
959963
/**
960964
* Returns a string representation of an array.
961965
*/
962966
toString(): string;
963967
toLocaleString(): string;
968+
/**
969+
* Appends new elements to an array, and returns the new length of the array.
970+
* @param items New elements of the Array.
971+
*/
972+
push(...items: T[]): number;
973+
/**
974+
* Removes the last element from an array and returns it.
975+
*/
976+
pop(): T;
964977
/**
965978
* Combines two or more arrays.
966979
* @param items Additional items to add to the end of array1.
@@ -976,15 +989,6 @@ interface Array<T> {
976989
* @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
977990
*/
978991
join(separator?: string): string;
979-
/**
980-
* Removes the last element from an array and returns it.
981-
*/
982-
pop(): T;
983-
/**
984-
* Appends new elements to an array, and returns the new length of the array.
985-
* @param items New elements of the Array.
986-
*/
987-
push(...items: T[]): number;
988992
/**
989993
* Reverses the elements in an Array.
990994
*/
@@ -1101,11 +1105,6 @@ interface Array<T> {
11011105
*/
11021106
reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
11031107

1104-
/**
1105-
* Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.
1106-
*/
1107-
length: number;
1108-
11091108
[n: number]: T;
11101109
}
11111110
declare var Array: {

bin/lib.d.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -956,11 +956,24 @@ declare var JSON: JSON;
956956
/////////////////////////////
957957

958958
interface Array<T> {
959+
/**
960+
* Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.
961+
*/
962+
length: number;
959963
/**
960964
* Returns a string representation of an array.
961965
*/
962966
toString(): string;
963967
toLocaleString(): string;
968+
/**
969+
* Appends new elements to an array, and returns the new length of the array.
970+
* @param items New elements of the Array.
971+
*/
972+
push(...items: T[]): number;
973+
/**
974+
* Removes the last element from an array and returns it.
975+
*/
976+
pop(): T;
964977
/**
965978
* Combines two or more arrays.
966979
* @param items Additional items to add to the end of array1.
@@ -976,15 +989,6 @@ interface Array<T> {
976989
* @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
977990
*/
978991
join(separator?: string): string;
979-
/**
980-
* Removes the last element from an array and returns it.
981-
*/
982-
pop(): T;
983-
/**
984-
* Appends new elements to an array, and returns the new length of the array.
985-
* @param items New elements of the Array.
986-
*/
987-
push(...items: T[]): number;
988992
/**
989993
* Reverses the elements in an Array.
990994
*/
@@ -1101,11 +1105,6 @@ interface Array<T> {
11011105
*/
11021106
reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
11031107

1104-
/**
1105-
* Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.
1106-
*/
1107-
length: number;
1108-
11091108
[n: number]: T;
11101109
}
11111110
declare var Array: {

0 commit comments

Comments
 (0)