Skip to content

Commit 60eee20

Browse files
author
Andy Hanson
committed
Merge branch 'master' into dts-first
2 parents ed30611 + 680bfbb commit 60eee20

File tree

390 files changed

+8544
-4340
lines changed

Some content is hidden

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

390 files changed

+8544
-4340
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,5 @@ internal/
5757
!tests/cases/projects/NodeModulesSearch/**/*
5858
!tests/baselines/reference/project/nodeModules*/**/*
5959
.idea
60-
yarn.lock
60+
yarn.lock
61+
package-lock.json

Gulpfile.ts

+2-8
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,8 @@ function needsUpdate(source: string | string[], dest: string | string[]): boolea
256256
return true;
257257
}
258258

259-
// Doing tsconfig inheritance manually. https://github.com/ivogabe/gulp-typescript/issues/459
260-
const tsconfigBase = JSON.parse(fs.readFileSync("src/tsconfig-base.json", "utf-8")).compilerOptions;
261-
262259
function getCompilerSettings(base: tsc.Settings, useBuiltCompiler?: boolean): tsc.Settings {
263260
const copy: tsc.Settings = {};
264-
for (const key in tsconfigBase) {
265-
copy[key] = tsconfigBase[key];
266-
}
267261
for (const key in base) {
268262
copy[key] = base[key];
269263
}
@@ -561,7 +555,7 @@ gulp.task(run, /*help*/ false, [servicesFile], () => {
561555
.pipe(newer(run))
562556
.pipe(sourcemaps.init())
563557
.pipe(testProject())
564-
.pipe(sourcemaps.write(".", { includeContent: false, sourceRoot: "../../" }))
558+
.pipe(sourcemaps.write(".", { includeContent: false, sourceRoot: "." }))
565559
.pipe(gulp.dest("src/harness"));
566560
});
567561

@@ -675,7 +669,7 @@ function runConsoleTests(defaultReporter: string, runInParallel: boolean, done:
675669
}
676670
args.push(run);
677671
setNodeEnvToDevelopment();
678-
runTestsInParallel(taskConfigsFolder, run, { testTimeout: testTimeout, noColors: colors === " --no-colors " }, function(err) {
672+
runTestsInParallel(taskConfigsFolder, run, { testTimeout, noColors: colors === " --no-colors " }, function(err) {
679673
// last worker clean everything and runs linter in case if there were no errors
680674
del(taskConfigsFolder).then(() => {
681675
if (!err) {

Jakefile.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ var harnessSources = harnessCoreSources.concat([
138138
"telemetry.ts",
139139
"transform.ts",
140140
"customTransforms.ts",
141+
"programMissingFiles.ts",
141142
].map(function (f) {
142143
return path.join(unittestsDirectory, f);
143144
})).concat([
@@ -286,7 +287,7 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, opts
286287
var startCompileTime = mark();
287288
opts = opts || {};
288289
var compilerPath = useBuiltCompiler ? builtLocalCompiler : LKGCompiler;
289-
var options = "--noImplicitAny --noImplicitThis --noEmitOnError --types "
290+
var options = "--noImplicitAny --noImplicitThis --alwaysStrict --noEmitOnError --types "
290291
if (opts.types) {
291292
options += opts.types.join(",");
292293
}

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

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

9-
[TypeScript](http://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](http://www.typescriptlang.org/Playground), and stay up to date via [our blog](https://blogs.msdn.microsoft.com/typescript) and [Twitter account](https://twitter.com/typescriptlang).
9+
[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).
1010

1111
## Installing
1212

@@ -27,8 +27,8 @@ npm install -g typescript@next
2727
There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript.
2828
* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
2929
* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls).
30-
* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript).
31-
* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter.
30+
* Engage with other TypeScript users and developers on [StackOverflow](https://stackoverflow.com/questions/tagged/typescript).
31+
* Join the [#typescript](https://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter.
3232
* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md).
3333
* Read the language specification ([docx](https://github.com/Microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.docx?raw=true),
3434
[pdf](https://github.com/Microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.pdf?raw=true), [md](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md)).
@@ -39,14 +39,14 @@ with any additional questions or comments.
3939

4040
## Documentation
4141

42-
* [Quick tutorial](http://www.typescriptlang.org/docs/tutorial.html)
43-
* [Programming handbook](http://www.typescriptlang.org/docs/handbook/basic-types.html)
42+
* [Quick tutorial](https://www.typescriptlang.org/docs/tutorial.html)
43+
* [Programming handbook](https://www.typescriptlang.org/docs/handbook/basic-types.html)
4444
* [Language specification](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md)
45-
* [Homepage](http://www.typescriptlang.org/)
45+
* [Homepage](https://www.typescriptlang.org/)
4646

4747
## Building
4848

49-
In order to build the TypeScript compiler, ensure that you have [Git](http://git-scm.com/downloads) and [Node.js](http://nodejs.org/) installed.
49+
In order to build the TypeScript compiler, ensure that you have [Git](https://git-scm.com/downloads) and [Node.js](https://nodejs.org/) installed.
5050

5151
Clone a copy of the repo:
5252

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"@types/convert-source-map": "latest",
3535
"@types/del": "latest",
3636
"@types/glob": "latest",
37-
"@types/gulp": "latest",
37+
"@types/gulp": "3.X",
3838
"@types/gulp-concat": "latest",
3939
"@types/gulp-help": "latest",
4040
"@types/gulp-newer": "latest",
@@ -52,7 +52,7 @@
5252
"chai": "latest",
5353
"convert-source-map": "latest",
5454
"del": "latest",
55-
"gulp": "latest",
55+
"gulp": "3.X",
5656
"gulp-clone": "latest",
5757
"gulp-concat": "latest",
5858
"gulp-help": "latest",

scripts/mocha-parallel.js

+43-4
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ function runTests(taskConfigsFolder, run, options, cb) {
7272
current: undefined,
7373
start: undefined,
7474
end: undefined,
75+
catastrophicError: "",
7576
failures: []
7677
};
7778
partitions[index] = partition;
@@ -86,9 +87,20 @@ function runTests(taskConfigsFolder, run, options, cb) {
8687
input: p.stdout,
8788
terminal: false
8889
});
90+
91+
var rlError = readline.createInterface({
92+
input: p.stderr,
93+
terminal: false
94+
});
95+
8996
rl.on("line", onmessage);
97+
rlError.on("line", onErrorMessage);
9098
p.on("exit", onexit)
9199

100+
function onErrorMessage(line) {
101+
partition.catastrophicError += line + os.EOL;
102+
}
103+
92104
function onmessage(line) {
93105
if (partition.start === undefined) {
94106
partition.start = Date.now();
@@ -153,15 +165,17 @@ function runTests(taskConfigsFolder, run, options, cb) {
153165
}
154166
}
155167

156-
function onexit() {
168+
function onexit(code) {
157169
if (partition.end === undefined) {
158170
partition.end = Date.now();
159171
}
160172

161173
partition.duration = partition.end - partition.start;
162-
var summaryColor = partition.failed ? "fail" : "green";
163-
var summarySymbol = partition.failed ? Base.symbols.err : Base.symbols.ok;
164-
var summaryTests = (partition.passed === partition.tests ? partition.passed : partition.passed + "/" + partition.tests) + " passing";
174+
var isPartitionFail = partition.failed || code !== 0;
175+
var summaryColor = isPartitionFail ? "fail" : "green";
176+
var summarySymbol = isPartitionFail ? Base.symbols.err : Base.symbols.ok;
177+
178+
var summaryTests = (isPartitionFail ? partition.passed + "/" + partition.tests : partition.passed) + " passing";
165179
var summaryDuration = "(" + ms(partition.duration) + ")";
166180
var savedUseColors = Base.useColors;
167181
Base.useColors = !options.noColors;
@@ -198,12 +212,34 @@ function runTests(taskConfigsFolder, run, options, cb) {
198212
failures = reporter.failures;
199213

200214
var duration = 0;
215+
var catastrophicError = "";
201216
for (var i = 0; i < numPartitions; i++) {
202217
var partition = partitions[i];
203218
stats.passes += partition.passed;
204219
stats.failures += partition.failed;
205220
stats.tests += partition.tests;
206221
duration += partition.duration;
222+
if (partition.catastrophicError !== "") {
223+
// Partition is written out to a temporary file as a JSON object.
224+
// Below is an example of how the partition JSON object looks like
225+
// {
226+
// "light":false,
227+
// "tasks":[
228+
// {
229+
// "runner":"compiler",
230+
// "files":["tests/cases/compiler/es6ImportNamedImportParsingError.ts"]
231+
// }
232+
// ],
233+
// "runUnitTests":false
234+
// }
235+
var jsonText = fs.readFileSync(partition.file);
236+
var configObj = JSON.parse(jsonText);
237+
if (configObj.tasks && configObj.tasks[0]) {
238+
catastrophicError += "Error from one or more of these files: " + configObj.tasks[0].files + os.EOL;
239+
catastrophicError += partition.catastrophicError;
240+
catastrophicError += os.EOL;
241+
}
242+
}
207243
for (var j = 0; j < partition.failures.length; j++) {
208244
var failure = partition.failures[j];
209245
failures.push(makeMochaTest(failure));
@@ -223,6 +259,9 @@ function runTests(taskConfigsFolder, run, options, cb) {
223259
reporter.epilogue();
224260
}
225261

262+
if (catastrophicError !== "") {
263+
return cb(new Error(catastrophicError));
264+
}
226265
if (stats.failures) {
227266
return cb(new Error("Test failures reported: " + stats.failures));
228267
}

scripts/tslint/booleanTriviaRule.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function walk(ctx: Lint.WalkContext<void>): void {
2727
/** Skip certain function/method names whose parameter names are not informative. */
2828
function shouldIgnoreCalledExpression(expression: ts.Expression): boolean {
2929
if (expression.kind === ts.SyntaxKind.PropertyAccessExpression) {
30-
const methodName = (expression as ts.PropertyAccessExpression).name.text;
30+
const methodName = (expression as ts.PropertyAccessExpression).name.text as string;
3131
if (methodName.indexOf("set") === 0) {
3232
return true;
3333
}
@@ -44,7 +44,7 @@ function walk(ctx: Lint.WalkContext<void>): void {
4444
}
4545
}
4646
else if (expression.kind === ts.SyntaxKind.Identifier) {
47-
const functionName = (expression as ts.Identifier).text;
47+
const functionName = (expression as ts.Identifier).text as string;
4848
if (functionName.indexOf("set") === 0) {
4949
return true;
5050
}

0 commit comments

Comments
 (0)