Skip to content

Commit ffae189

Browse files
Merge branch 'master' into unrewrite
Conflicts: src/compiler/emitter.ts tests/baselines/reference/ES5SymbolProperty1.js tests/baselines/reference/FunctionDeclaration8_es6.js tests/baselines/reference/FunctionDeclaration9_es6.js tests/baselines/reference/FunctionPropertyAssignments5_es6.js tests/baselines/reference/computedPropertyNames10_ES5.js tests/baselines/reference/computedPropertyNames11_ES5.js tests/baselines/reference/computedPropertyNames18_ES5.js tests/baselines/reference/computedPropertyNames19_ES5.js tests/baselines/reference/computedPropertyNames1_ES5.js tests/baselines/reference/computedPropertyNames20_ES5.js tests/baselines/reference/computedPropertyNames22_ES5.js tests/baselines/reference/computedPropertyNames23_ES5.js tests/baselines/reference/computedPropertyNames25_ES5.js tests/baselines/reference/computedPropertyNames26_ES5.js tests/baselines/reference/computedPropertyNames28_ES5.js tests/baselines/reference/computedPropertyNames29_ES5.js tests/baselines/reference/computedPropertyNames30_ES5.js tests/baselines/reference/computedPropertyNames31_ES5.js tests/baselines/reference/computedPropertyNames33_ES5.js tests/baselines/reference/computedPropertyNames34_ES5.js tests/baselines/reference/computedPropertyNames46_ES5.js tests/baselines/reference/computedPropertyNames47_ES5.js tests/baselines/reference/computedPropertyNames48_ES5.js tests/baselines/reference/computedPropertyNames49_ES5.js tests/baselines/reference/computedPropertyNames4_ES5.js tests/baselines/reference/computedPropertyNames50_ES5.js tests/baselines/reference/computedPropertyNames5_ES5.js tests/baselines/reference/computedPropertyNames6_ES5.js tests/baselines/reference/computedPropertyNames7_ES5.js tests/baselines/reference/computedPropertyNames8_ES5.js tests/baselines/reference/computedPropertyNames9_ES5.js tests/baselines/reference/computedPropertyNamesContextualType10_ES5.js tests/baselines/reference/computedPropertyNamesContextualType1_ES5.js tests/baselines/reference/computedPropertyNamesContextualType2_ES5.js tests/baselines/reference/computedPropertyNamesContextualType3_ES5.js tests/baselines/reference/computedPropertyNamesContextualType4_ES5.js tests/baselines/reference/computedPropertyNamesContextualType5_ES5.js tests/baselines/reference/computedPropertyNamesContextualType6_ES5.js tests/baselines/reference/computedPropertyNamesContextualType7_ES5.js tests/baselines/reference/computedPropertyNamesContextualType8_ES5.js tests/baselines/reference/computedPropertyNamesContextualType9_ES5.js tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.js tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt tests/baselines/reference/parserES5ComputedPropertyName2.js tests/baselines/reference/parserES5ComputedPropertyName3.js tests/baselines/reference/parserES5ComputedPropertyName4.js tests/baselines/reference/privateIndexer2.js
2 parents 0af4b8a + 5e7343f commit ffae189

File tree

4,599 files changed

+160755
-111320
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,599 files changed

+160755
-111320
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
root = true
3+
4+
[{src,scripts}/**.{ts,json,js}]
5+
end_of_line = crlf
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
indent_style = space
10+
indent_size = 4

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.js linguist-language=TypeScript

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ tests/services/baselines/local/*
2121
tests/baselines/prototyping/local/*
2222
tests/baselines/rwc/*
2323
tests/baselines/test262/*
24+
tests/baselines/local/projectOutput/*
2425
tests/services/baselines/prototyping/local/*
2526
tests/services/browser/typescriptServices.js
2627
scripts/processDiagnosticMessages.d.ts

.travis.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,4 @@ language: node_js
33
node_js:
44
- '0.10'
55

6-
sudo: false
7-
8-
before_script: npm install -g codeclimate-test-reporter
9-
10-
after_script:
11-
- cat coverage/lcov.info | codeclimate
12-
13-
addons:
14-
code_climate:
15-
repo_token: 9852ac5362c8cc38c07ca5adc0f94c20c6c79bd78e17933dc284598a65338656
6+
sudo: false

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Design changes will not be accepted at this time. If you have a design change pr
99
## Legal
1010
You will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project's license, and that the work being submitted is under appropriate copyright.
1111

12-
Please submit a Contributor License Agreement (CLA) before submitting a pull request. Download the agreement ([Microsoft Contribution License Agreement.docx](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=822190) or [Microsoft Contribution License Agreement.pdf](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=921298)), sign, scan, and email it back to <cla@microsoft.com>. Be sure to include your github user name along with the agreement. Once we have received the signed CLA, we'll review the request. Please note that we're currently only accepting pull requests of bug fixes rather than new features.
12+
Please submit a Contributor License Agreement (CLA) before submitting a pull request. You may visit https://cla.microsoft.com to sign digitally. Alternatively, download the agreement ([Microsoft Contribution License Agreement.docx](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=822190) or [Microsoft Contribution License Agreement.pdf](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=921298)), sign, scan, and email it back to <cla@microsoft.com>. Be sure to include your github user name along with the agreement. Once we have received the signed CLA, we'll review the request. Please note that we're currently only accepting pull requests of bug fixes rather than new features.
1313

1414
## Housekeeping
1515
Your pull request should:

Jakefile

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ var compilerSources = [
3939
"utilities.ts",
4040
"binder.ts",
4141
"checker.ts",
42+
"declarationEmitter.ts",
4243
"emitter.ts",
4344
"program.ts",
4445
"commandLineParser.ts",
@@ -57,6 +58,7 @@ var servicesSources = [
5758
"utilities.ts",
5859
"binder.ts",
5960
"checker.ts",
61+
"declarationEmitter.ts",
6062
"emitter.ts",
6163
"program.ts",
6264
"commandLineParser.ts",
@@ -65,7 +67,7 @@ var servicesSources = [
6567
return path.join(compilerDirectory, f);
6668
}).concat([
6769
"breakpoints.ts",
68-
"navigateTo.ts",
70+
"navigateTo.ts",
6971
"navigationBar.ts",
7072
"outliningElementsCollector.ts",
7173
"patternMatcher.ts",
@@ -109,6 +111,7 @@ var definitionsRoots = [
109111
"compiler/parser.d.ts",
110112
"compiler/checker.d.ts",
111113
"compiler/program.d.ts",
114+
"compiler/commandLineParser.d.ts",
112115
"services/services.d.ts",
113116
];
114117

@@ -141,7 +144,8 @@ var harnessSources = [
141144
"services/colorization.ts",
142145
"services/documentRegistry.ts",
143146
"services/preProcessFile.ts",
144-
"services/patternMatcher.ts"
147+
"services/patternMatcher.ts",
148+
"versionCache.ts"
145149
].map(function (f) {
146150
return path.join(unittestsDirectory, f);
147151
})).concat([
@@ -220,15 +224,17 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu
220224
var dir = useBuiltCompiler ? builtLocalDirectory : LKGDirectory;
221225
var options = "--module commonjs -noImplicitAny";
222226

223-
if (!keepComments) {
224-
options += " -removeComments";
227+
// Keep comments when specifically requested
228+
// or when in debug mode.
229+
if (!(keepComments || useDebugMode)) {
230+
options += " --removeComments";
225231
}
226232

227233
if (generateDeclarations) {
228234
options += " --declaration";
229235
}
230236

231-
if (useDebugMode || preserveConstEnums) {
237+
if (preserveConstEnums || useDebugMode) {
232238
options += " --preserveConstEnums";
233239
}
234240

@@ -463,7 +469,7 @@ task("generate-spec", [specMd])
463469
// Makes a new LKG. This target does not build anything, but errors if not all the outputs are present in the built/local directory
464470
desc("Makes a new LKG out of the built js files");
465471
task("LKG", ["clean", "release", "local"].concat(libraryTargets), function() {
466-
var expectedFiles = [tscFile, servicesFile, nodePackageFile, nodeDefinitionsFile, standaloneDefinitionsFile, internalNodeDefinitionsFile, internalStandaloneDefinitionsFile].concat(libraryTargets);
472+
var expectedFiles = [tscFile, servicesFile, serverFile, nodePackageFile, nodeDefinitionsFile, standaloneDefinitionsFile, internalNodeDefinitionsFile, internalStandaloneDefinitionsFile].concat(libraryTargets);
467473
var missingFiles = expectedFiles.filter(function (f) {
468474
return !fs.existsSync(f);
469475
});
@@ -537,7 +543,7 @@ function cleanTestDirs() {
537543
}
538544

539545
jake.mkdirP(localRwcBaseline);
540-
jake.mkdirP(localTest262Baseline);
546+
jake.mkdirP(localTest262Baseline);
541547
jake.mkdirP(localBaseline);
542548
}
543549

@@ -574,7 +580,7 @@ task("runtests", ["tests", builtLocalDirectory], function() {
574580
}
575581

576582
colors = process.env.colors || process.env.color
577-
colors = colors ? ' --no-colors ' : ''
583+
colors = colors ? ' --no-colors ' : ' --colors ';
578584
tests = tests ? ' -g ' + tests : '';
579585
reporter = process.env.reporter || process.env.r || 'dot';
580586
// timeout normally isn't necessary but Travis-CI has been timing out on compiler baselines occasionally
@@ -716,7 +722,7 @@ file(loggedIOJsPath, [builtLocalDirectory, loggedIOpath], function() {
716722

717723
var instrumenterPath = harnessDirectory + 'instrumenter.ts';
718724
var instrumenterJsPath = builtLocalDirectory + 'instrumenter.js';
719-
compileFile(instrumenterJsPath, [instrumenterPath], [tscFile, instrumenterPath], [], /*useBuiltCompiler*/ true);
725+
compileFile(instrumenterJsPath, [instrumenterPath], [tscFile, instrumenterPath].concat(libraryTargets), [], /*useBuiltCompiler*/ true);
720726

721727
desc("Builds an instrumented tsc.js");
722728
task('tsc-instrumented', [loggedIOJsPath, instrumenterJsPath, tscFile], function() {

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[![Build Status](https://travis-ci.org/Microsoft/TypeScript.svg?branch=master)](https://travis-ci.org/Microsoft/TypeScript)
22
[![Issue Stats](http://issuestats.com/github/Microsoft/TypeScript/badge/pr)](http://issuestats.com/github/microsoft/typescript)
33
[![Issue Stats](http://issuestats.com/github/Microsoft/TypeScript/badge/issue)](http://issuestats.com/github/microsoft/typescript)
4+
[![npm version](https://badge.fury.io/js/typescript.svg)](http://badge.fury.io/js/typescript)
5+
[![Downloads](http://img.shields.io/npm/dm/TypeScript.svg)](https://npmjs.org/package/typescript)
46

57
# TypeScript
68

bin/lib.core.d.ts

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,19 +179,19 @@ interface ObjectConstructor {
179179
* Prevents the modification of attributes of existing properties, and prevents the addition of new properties.
180180
* @param o Object on which to lock the attributes.
181181
*/
182-
seal(o: any): any;
182+
seal<T>(o: T): T;
183183

184184
/**
185185
* Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
186186
* @param o Object on which to lock the attributes.
187187
*/
188-
freeze(o: any): any;
188+
freeze<T>(o: T): T;
189189

190190
/**
191191
* Prevents the addition of new properties to an object.
192192
* @param o Object to make non-extensible.
193193
*/
194-
preventExtensions(o: any): any;
194+
preventExtensions<T>(o: T): T;
195195

196196
/**
197197
* Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object.
@@ -425,6 +425,9 @@ interface String {
425425
*/
426426
substr(from: number, length?: number): string;
427427

428+
/** Returns the primitive value of the specified object. */
429+
valueOf(): string;
430+
428431
[index: number]: string;
429432
}
430433

@@ -477,6 +480,9 @@ interface Number {
477480
* @param precision Number of significant digits. Must be in the range 1 - 21, inclusive.
478481
*/
479482
toPrecision(precision?: number): string;
483+
484+
/** Returns the primitive value of the specified object. */
485+
valueOf(): number;
480486
}
481487

482488
interface NumberConstructor {
@@ -1164,3 +1170,17 @@ interface ArrayConstructor {
11641170
}
11651171

11661172
declare var Array: ArrayConstructor;
1173+
1174+
interface TypedPropertyDescriptor<T> {
1175+
enumerable?: boolean;
1176+
configurable?: boolean;
1177+
writable?: boolean;
1178+
value?: T;
1179+
get?: () => T;
1180+
set?: (value: T) => void;
1181+
}
1182+
1183+
declare type ClassDecorator = <TFunction extends Function>(target: TFunction) => TFunction | void;
1184+
declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;
1185+
declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
1186+
declare type ParameterDecorator = (target: Function, propertyKey: string | symbol, parameterIndex: number) => void;

0 commit comments

Comments
 (0)