Skip to content

Commit f8f244f

Browse files
committed
Merge branch 'master' into new-jsdoc-parser
2 parents e2ff42f + e9178a5 commit f8f244f

File tree

4,761 files changed

+154901
-61478
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,761 files changed

+154901
-61478
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ test-args.txt
99
\#*\#
1010
.\#*
1111
tests/baselines/local/*
12+
tests/baselines/local.old/*
1213
tests/services/baselines/local/*
1314
tests/baselines/prototyping/local/*
1415
tests/baselines/rwc/*
1516
tests/baselines/test262/*
1617
tests/baselines/reference/projectOutput/*
1718
tests/baselines/local/projectOutput/*
19+
tests/baselines/reference/testresults.tap
1820
tests/services/baselines/prototyping/local/*
1921
tests/services/browser/typescriptServices.js
2022
scripts/authors.js
@@ -52,3 +54,4 @@ internal/
5254
!tests/cases/projects/projectOption/**/node_modules
5355
!tests/cases/projects/NodeModulesSearch/**/*
5456
!tests/baselines/reference/project/nodeModules*/**/*
57+
.idea

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ matrix:
2323
branches:
2424
only:
2525
- master
26-
- transforms
26+
- release-2.0
2727

2828
install:
2929
- npm uninstall typescript

CONTRIBUTING.md

-4
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ In general, things we find useful when reviewing suggestions are:
4040

4141
# Instructions for Contributing Code
4242

43-
## Code of Conduct
44-
45-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
46-
4743
## Contributing bug fixes
4844

4945
TypeScript is currently accepting contributions in the form of bug fixes. A bug must have an issue tracking it in the issue tracker that has been approved ("Milestone == Community") by the TypeScript team. Your pull request should include a link to the bug that you are fixing. If you've submitted a PR for a bug, please post a comment in the bug to avoid duplication of effort.

Gulpfile.ts

+11-7
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ const gulp = helpMaker(originalGulp);
3939
const mochaParallel = require("./scripts/mocha-parallel.js");
4040
const {runTestsInParallel} = mochaParallel;
4141

42+
Error.stackTraceLimit = 1000;
43+
4244
const cmdLineOptions = minimist(process.argv.slice(2), {
4345
boolean: ["debug", "light", "colors", "lint", "soft"],
44-
string: ["browser", "tests", "host", "reporter"],
46+
string: ["browser", "tests", "host", "reporter", "stackTraceLimit"],
4547
alias: {
4648
d: "debug",
4749
t: "tests",
@@ -559,6 +561,7 @@ function runConsoleTests(defaultReporter: string, runInParallel: boolean, done:
559561
const debug = cmdLineOptions["debug"];
560562
const tests = cmdLineOptions["tests"];
561563
const light = cmdLineOptions["light"];
564+
const stackTraceLimit = cmdLineOptions["stackTraceLimit"];
562565
const testConfigFile = "test.config";
563566
if (fs.existsSync(testConfigFile)) {
564567
fs.unlinkSync(testConfigFile);
@@ -578,7 +581,7 @@ function runConsoleTests(defaultReporter: string, runInParallel: boolean, done:
578581
}
579582

580583
if (tests || light || taskConfigsFolder) {
581-
writeTestConfigFile(tests, light, taskConfigsFolder, workerCount);
584+
writeTestConfigFile(tests, light, taskConfigsFolder, workerCount, stackTraceLimit);
582585
}
583586

584587
if (tests && tests.toLocaleLowerCase() === "rwc") {
@@ -727,6 +730,7 @@ gulp.task("browserify", "Runs browserify on run.js to produce a file suitable fo
727730
sourcemaps: {
728731
"built/local/_stream_0.js": originalMap,
729732
"built/local/bundle.js": maps,
733+
"node_modules/source-map-support/source-map-support.js": undefined,
730734
}
731735
});
732736
const finalMap = chain.apply();
@@ -756,8 +760,8 @@ function cleanTestDirs(done: (e?: any) => void) {
756760
}
757761

758762
// used to pass data from jake command line directly to run.js
759-
function writeTestConfigFile(tests: string, light: boolean, taskConfigsFolder?: string, workerCount?: number) {
760-
const testConfigContents = JSON.stringify({ test: tests ? [tests] : undefined, light: light, workerCount: workerCount, taskConfigsFolder: taskConfigsFolder });
763+
function writeTestConfigFile(tests: string, light: boolean, taskConfigsFolder?: string, workerCount?: number, stackTraceLimit?: string) {
764+
const testConfigContents = JSON.stringify({ test: tests ? [tests] : undefined, light, workerCount, stackTraceLimit, taskConfigsFolder });
761765
console.log("Running tests with config: " + testConfigContents);
762766
fs.writeFileSync("test.config", testConfigContents);
763767
}
@@ -887,7 +891,7 @@ gulp.task(loggedIOJsPath, false, [], (done) => {
887891
const temp = path.join(builtLocalDirectory, "temp");
888892
mkdirP(temp, (err) => {
889893
if (err) { console.error(err); done(err); process.exit(1); };
890-
exec(host, [LKGCompiler, "--outdir", temp, loggedIOpath], () => {
894+
exec(host, [LKGCompiler, "--types --outdir", temp, loggedIOpath], () => {
891895
fs.renameSync(path.join(temp, "/harness/loggedIO.js"), loggedIOJsPath);
892896
del(temp).then(() => done(), done);
893897
}, done);
@@ -908,8 +912,8 @@ gulp.task(instrumenterJsPath, false, [servicesFile], () => {
908912
.pipe(gulp.dest("."));
909913
});
910914

911-
gulp.task("tsc-instrumented", "Builds an instrumented tsc.js", [loggedIOJsPath, instrumenterJsPath, servicesFile], (done) => {
912-
exec(host, [instrumenterJsPath, "record", "iocapture", builtLocalDirectory, compilerFilename], done, done);
915+
gulp.task("tsc-instrumented", "Builds an instrumented tsc.js", ["local", loggedIOJsPath, instrumenterJsPath, servicesFile], (done) => {
916+
exec(host, [instrumenterJsPath, "record", "iocapture", builtLocalCompiler], done, done);
913917
});
914918

915919
gulp.task("update-sublime", "Updates the sublime plugin's tsserver", ["local", serverFile], () => {

Jakefile.js

+77-20
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,20 @@ var compilerSources = [
6464
"utilities.ts",
6565
"binder.ts",
6666
"checker.ts",
67+
"factory.ts",
68+
"visitor.ts",
69+
"transformers/destructuring.ts",
70+
"transformers/ts.ts",
71+
"transformers/module/es6.ts",
72+
"transformers/module/system.ts",
73+
"transformers/module/module.ts",
74+
"transformers/jsx.ts",
75+
"transformers/es7.ts",
76+
"transformers/generators.ts",
77+
"transformers/es6.ts",
78+
"transformer.ts",
6779
"sourcemap.ts",
80+
"comments.ts",
6881
"declarationEmitter.ts",
6982
"emitter.ts",
7083
"program.ts",
@@ -85,7 +98,20 @@ var servicesSources = [
8598
"utilities.ts",
8699
"binder.ts",
87100
"checker.ts",
101+
"factory.ts",
102+
"visitor.ts",
103+
"transformers/destructuring.ts",
104+
"transformers/ts.ts",
105+
"transformers/module/es6.ts",
106+
"transformers/module/system.ts",
107+
"transformers/module/module.ts",
108+
"transformers/jsx.ts",
109+
"transformers/es7.ts",
110+
"transformers/generators.ts",
111+
"transformers/es6.ts",
112+
"transformer.ts",
88113
"sourcemap.ts",
114+
"comments.ts",
89115
"declarationEmitter.ts",
90116
"emitter.ts",
91117
"program.ts",
@@ -94,15 +120,28 @@ var servicesSources = [
94120
].map(function (f) {
95121
return path.join(compilerDirectory, f);
96122
}).concat([
123+
"types.ts",
124+
"utilities.ts",
97125
"breakpoints.ts",
126+
"classifier.ts",
127+
"completions.ts",
128+
"documentHighlights.ts",
129+
"documentRegistry.ts",
130+
"findAllReferences.ts",
131+
"goToDefinition.ts",
132+
"jsDoc.ts",
133+
"jsTyping.ts",
98134
"navigateTo.ts",
99135
"navigationBar.ts",
100136
"outliningElementsCollector.ts",
101137
"patternMatcher.ts",
138+
"preProcess.ts",
139+
"rename.ts",
102140
"services.ts",
103141
"shims.ts",
104142
"signatureHelp.ts",
105-
"utilities.ts",
143+
"symbolDisplay.ts",
144+
"transpile.ts",
106145
"formatting/formatting.ts",
107146
"formatting/formattingContext.ts",
108147
"formatting/formattingRequestKind.ts",
@@ -177,6 +216,7 @@ var harnessSources = harnessCoreSources.concat([
177216
"moduleResolution.ts",
178217
"tsconfigParsing.ts",
179218
"commandLineParsing.ts",
219+
"configurationExtension.ts",
180220
"convertCompilerOptionsFromJson.ts",
181221
"convertTypingOptionsFromJson.ts",
182222
"tsserverProjectSystem.ts",
@@ -307,7 +347,10 @@ var builtLocalCompiler = path.join(builtLocalDirectory, compilerFilename);
307347
* @param callback: a function to execute after the compilation process ends
308348
*/
309349
function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, opts, callback) {
310-
file(outFile, prereqs, function () {
350+
file(outFile, prereqs, function() {
351+
if (process.env.USE_TRANSFORMS === "false") {
352+
useBuiltCompiler = false;
353+
}
311354
var startCompileTime = mark();
312355
opts = opts || {};
313356
var compilerPath = useBuiltCompiler ? builtLocalCompiler : LKGCompiler;
@@ -745,8 +788,14 @@ function cleanTestDirs() {
745788
}
746789

747790
// used to pass data from jake command line directly to run.js
748-
function writeTestConfigFile(tests, light, taskConfigsFolder, workerCount) {
749-
var testConfigContents = JSON.stringify({ test: tests ? [tests] : undefined, light: light, workerCount: workerCount, taskConfigsFolder: taskConfigsFolder });
791+
function writeTestConfigFile(tests, light, taskConfigsFolder, workerCount, stackTraceLimit) {
792+
var testConfigContents = JSON.stringify({
793+
test: tests ? [tests] : undefined,
794+
light: light,
795+
workerCount: workerCount,
796+
taskConfigsFolder: taskConfigsFolder,
797+
stackTraceLimit: stackTraceLimit
798+
});
750799
fs.writeFileSync('test.config', testConfigContents);
751800
}
752801

@@ -757,10 +806,15 @@ function deleteTemporaryProjectOutput() {
757806
}
758807

759808
function runConsoleTests(defaultReporter, runInParallel) {
760-
cleanTestDirs();
809+
var dirty = process.env.dirty;
810+
if (!dirty) {
811+
cleanTestDirs();
812+
}
813+
761814
var debug = process.env.debug || process.env.d;
762815
tests = process.env.test || process.env.tests || process.env.t;
763816
var light = process.env.light || false;
817+
var stackTraceLimit = process.env.stackTraceLimit;
764818
var testConfigFile = 'test.config';
765819
if (fs.existsSync(testConfigFile)) {
766820
fs.unlinkSync(testConfigFile);
@@ -780,7 +834,7 @@ function runConsoleTests(defaultReporter, runInParallel) {
780834
}
781835

782836
if (tests || light || taskConfigsFolder) {
783-
writeTestConfigFile(tests, light, taskConfigsFolder, workerCount);
837+
writeTestConfigFile(tests, light, taskConfigsFolder, workerCount, stackTraceLimit);
784838
}
785839

786840
if (tests && tests.toLocaleLowerCase() === "rwc") {
@@ -849,7 +903,7 @@ function runConsoleTests(defaultReporter, runInParallel) {
849903
}
850904
}
851905
function runLinter() {
852-
if (!lintFlag) {
906+
if (!lintFlag || dirty) {
853907
return;
854908
}
855909
var lint = jake.Task['lint'];
@@ -866,8 +920,8 @@ task("runtests-parallel", ["build-rules", "tests", builtLocalDirectory], functio
866920
runConsoleTests('min', /*runInParallel*/ true);
867921
}, { async: true });
868922

869-
desc("Runs the tests using the built run.js file. Optional arguments are: t[ests]=regex r[eporter]=[list|spec|json|<more>] d[ebug]=true color[s]=false lint=true bail=false.");
870-
task("runtests", ["build-rules", "tests", builtLocalDirectory], function () {
923+
desc("Runs the tests using the built run.js file. Optional arguments are: t[ests]=regex r[eporter]=[list|spec|json|<more>] d[ebug]=true color[s]=false lint=true bail=false dirty=false.");
924+
task("runtests", ["build-rules", "tests", builtLocalDirectory], function() {
871925
runConsoleTests('mocha-fivemat-progress-reporter', /*runInParallel*/ false);
872926
}, { async: true });
873927

@@ -884,8 +938,8 @@ var nodeServerInFile = "tests/webTestServer.ts";
884938
compileFile(nodeServerOutFile, [nodeServerInFile], [builtLocalDirectory, tscFile], [], /*useBuiltCompiler:*/ true, { noOutFile: true });
885939

886940
desc("Runs browserify on run.js to produce a file suitable for running tests in the browser");
887-
task("browserify", ["tests", builtLocalDirectory, nodeServerOutFile], function () {
888-
var cmd = 'browserify built/local/run.js -d -o built/local/bundle.js';
941+
task("browserify", ["tests", builtLocalDirectory, nodeServerOutFile], function() {
942+
var cmd = 'browserify built/local/run.js -t ./scripts/browserify-optional -d -o built/local/bundle.js';
889943
exec(cmd);
890944
}, { async: true });
891945

@@ -951,15 +1005,18 @@ function acceptBaseline(containerFolder) {
9511005
var deleteEnding = '.delete';
9521006
for (var i in files) {
9531007
var filename = files[i];
954-
if (filename.substr(filename.length - deleteEnding.length) === deleteEnding) {
955-
filename = filename.substr(0, filename.length - deleteEnding.length);
956-
fs.unlinkSync(path.join(targetFolder, filename));
957-
} else {
958-
var target = path.join(targetFolder, filename);
959-
if (fs.existsSync(target)) {
960-
fs.unlinkSync(target);
1008+
var fullLocalPath = path.join(sourceFolder, filename);
1009+
if (fs.statSync(fullLocalPath).isFile()) {
1010+
if (filename.substr(filename.length - deleteEnding.length) === deleteEnding) {
1011+
filename = filename.substr(0, filename.length - deleteEnding.length);
1012+
fs.unlinkSync(path.join(targetFolder, filename));
1013+
} else {
1014+
var target = path.join(targetFolder, filename);
1015+
if (fs.existsSync(target)) {
1016+
fs.unlinkSync(target);
1017+
}
1018+
fs.renameSync(path.join(sourceFolder, filename), target);
9611019
}
962-
fs.renameSync(path.join(sourceFolder, filename), target);
9631020
}
9641021
}
9651022
}
@@ -998,7 +1055,7 @@ var loggedIOJsPath = builtLocalDirectory + 'loggedIO.js';
9981055
file(loggedIOJsPath, [builtLocalDirectory, loggedIOpath], function () {
9991056
var temp = builtLocalDirectory + 'temp';
10001057
jake.mkdirP(temp);
1001-
var options = "--outdir " + temp + ' ' + loggedIOpath;
1058+
var options = "--types --outdir " + temp + ' ' + loggedIOpath;
10021059
var cmd = host + " " + LKGDirectory + compilerFilename + " " + options + " ";
10031060
console.log(cmd + "\n");
10041061
var ex = jake.createExec([cmd]);

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob
3030
* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript).
3131
* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter.
3232
* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md).
33-
* Read the language specification ([docx](https://github.com/Microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.docx?raw=true), [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)).
33+
* Read the language specification ([docx](https://github.com/Microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.docx?raw=true),
34+
[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)).
3435

36+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see
37+
the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com)
38+
with any additional questions or comments.
3539

3640
## Documentation
3741

@@ -91,4 +95,4 @@ node built/local/tsc.js hello.ts
9195

9296
## Roadmap
9397

94-
For details on our planned features and future direction please refer to our [roadmap](https://github.com/Microsoft/TypeScript/wiki/Roadmap).
98+
For details on our planned features and future direction please refer to our [roadmap](https://github.com/Microsoft/TypeScript/wiki/Roadmap).

lib/lib.es2015.collection.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ interface Map<K, V> {
2020
forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
2121
get(key: K): V | undefined;
2222
has(key: K): boolean;
23-
set(key: K, value?: V): this;
23+
set(key: K, value: V): this;
2424
readonly size: number;
2525
}
2626

@@ -36,7 +36,7 @@ interface WeakMap<K, V> {
3636
delete(key: K): boolean;
3737
get(key: K): V | undefined;
3838
has(key: K): boolean;
39-
set(key: K, value?: V): this;
39+
set(key: K, value: V): this;
4040
}
4141

4242
interface WeakMapConstructor {

lib/lib.es2015.proxy.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface ProxyHandler<T> {
1919
setPrototypeOf? (target: T, v: any): boolean;
2020
isExtensible? (target: T): boolean;
2121
preventExtensions? (target: T): boolean;
22-
getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor;
22+
getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor | undefined;
2323
has? (target: T, p: PropertyKey): boolean;
2424
get? (target: T, p: PropertyKey, receiver: any): any;
2525
set? (target: T, p: PropertyKey, value: any, receiver: any): boolean;
@@ -35,4 +35,4 @@ interface ProxyConstructor {
3535
revocable<T>(target: T, handler: ProxyHandler<T>): { proxy: T; revoke: () => void; };
3636
new <T>(target: T, handler: ProxyHandler<T>): T
3737
}
38-
declare var Proxy: ProxyConstructor;
38+
declare var Proxy: ProxyConstructor;

0 commit comments

Comments
 (0)