Skip to content

Commit fc1888e

Browse files
committed
Merge branch 'master' into intersectionTypes
Conflicts: tests/baselines/reference/APISample_linter.js
2 parents 144a635 + b294443 commit fc1888e

File tree

473 files changed

+9240
-1457
lines changed

Some content is hidden

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

473 files changed

+9240
-1457
lines changed

Jakefile.js

+6
Original file line numberDiff line numberDiff line change
@@ -715,3 +715,9 @@ task('tsc-instrumented', [loggedIOJsPath, instrumenterJsPath, tscFile], function
715715
});
716716
ex.run();
717717
}, { async: true });
718+
719+
desc("Updates the sublime plugin's tsserver");
720+
task("update-sublime", [serverFile], function() {
721+
jake.cpR(serverFile, "../TypeScript-Sublime-Plugin/tsserver/");
722+
jake.cpR(serverFile + ".map", "../TypeScript-Sublime-Plugin/tsserver/");
723+
});

src/compiler/binder.ts

+14-4
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,14 @@ namespace ts {
173173
return node.name ? declarationNameToString(node.name) : getDeclarationName(node);
174174
}
175175

176+
/**
177+
* Declares a Symbol for the node and adds it to symbols. Reports errors for conflicting identifier names.
178+
* @param symbolTable - The symbol table which node will be added to.
179+
* @param parent - node's parent declaration.
180+
* @param node - The declaration to be added to the symbol table
181+
* @param includes - The SymbolFlags that node has in addition to its declaration type (eg: export, ambient, etc.)
182+
* @param excludes - The flags which node cannot be declared alongside in a symbol table. Used to report forbidden declarations.
183+
*/
176184
function declareSymbol(symbolTable: SymbolTable, parent: Symbol, node: Declaration, includes: SymbolFlags, excludes: SymbolFlags): Symbol {
177185
Debug.assert(!hasDynamicName(node));
178186

@@ -181,10 +189,11 @@ namespace ts {
181189

182190
let symbol: Symbol;
183191
if (name !== undefined) {
192+
184193
// Check and see if the symbol table already has a symbol with this name. If not,
185194
// create a new symbol with this name and add it to the table. Note that we don't
186195
// give the new symbol any flags *yet*. This ensures that it will not conflict
187-
// witht he 'excludes' flags we pass in.
196+
// with the 'excludes' flags we pass in.
188197
//
189198
// If we do get an existing symbol, see if it conflicts with the new symbol we're
190199
// creating. For example, a 'var' symbol and a 'class' symbol will conflict within
@@ -202,10 +211,10 @@ namespace ts {
202211
symbol = hasProperty(symbolTable, name)
203212
? symbolTable[name]
204213
: (symbolTable[name] = createSymbol(SymbolFlags.None, name));
205-
214+
206215
if (name && (includes & SymbolFlags.Classifiable)) {
207-
classifiableNames[name] = name;
208-
}
216+
classifiableNames[name] = name;
217+
}
209218

210219
if (symbol.flags & excludes) {
211220
if (node.name) {
@@ -314,6 +323,7 @@ namespace ts {
314323

315324
addToContainerChain(container);
316325
}
326+
317327
else if (containerFlags & ContainerFlags.IsBlockScopedContainer) {
318328
blockScopeContainer = node;
319329
blockScopeContainer.locals = undefined;

src/compiler/checker.ts

+885-183
Large diffs are not rendered by default.

src/compiler/commandLineParser.ts

+5
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ namespace ts {
203203
type: "boolean",
204204
description: Diagnostics.Watch_input_files,
205205
},
206+
{
207+
name: "experimentalAsyncFunctions",
208+
type: "boolean",
209+
description: Diagnostics.Enables_experimental_support_for_ES7_async_functions
210+
},
206211
{
207212
name: "experimentalDecorators",
208213
type: "boolean",

src/compiler/core.ts

+17-10
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22

33
/* @internal */
44
namespace ts {
5-
// Ternary values are defined such that
6-
// x & y is False if either x or y is False.
7-
// x & y is Maybe if either x or y is Maybe, but neither x or y is False.
8-
// x & y is True if both x and y are True.
9-
// x | y is False if both x and y are False.
10-
// x | y is Maybe if either x or y is Maybe, but neither x or y is True.
11-
// x | y is True if either x or y is True.
5+
/**
6+
* Ternary values are defined such that
7+
* x & y is False if either x or y is False.
8+
* x & y is Maybe if either x or y is Maybe, but neither x or y is False.
9+
* x & y is True if both x and y are True.
10+
* x | y is False if both x and y are False.
11+
* x | y is Maybe if either x or y is Maybe, but neither x or y is True.
12+
* x | y is True if either x or y is True.
13+
*/
1214
export const enum Ternary {
1315
False = 0,
1416
Maybe = 1,
15-
True = -1
17+
True = -1
1618
}
1719

1820
export function createFileMap<T>(getCanonicalFileName: (fileName: string) => string): FileMap<T> {
@@ -59,6 +61,11 @@ namespace ts {
5961

6062
export interface StringSet extends Map<any> { }
6163

64+
/**
65+
* Iterates through 'array' by index and performs the callback on each element of array until the callback
66+
* returns a truthy value, then returns that value.
67+
* If no such value is found, the callback is applied to each element of array and undefined is returned.
68+
*/
6269
export function forEach<T, U>(array: T[], callback: (element: T, index: number) => U): U {
6370
if (array) {
6471
for (let i = 0, len = array.length; i < len; i++) {
@@ -757,8 +764,8 @@ namespace ts {
757764
}
758765
Node.prototype = {
759766
kind: kind,
760-
pos: 0,
761-
end: 0,
767+
pos: -1,
768+
end: -1,
762769
flags: 0,
763770
parent: undefined,
764771
};

src/compiler/declarationEmitter.ts

+7
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,9 @@ namespace ts {
594594
if (node.flags & NodeFlags.Static) {
595595
write("static ");
596596
}
597+
if (node.flags & NodeFlags.Abstract) {
598+
write("abstract ");
599+
}
597600
}
598601

599602
function writeImportEqualsDeclaration(node: ImportEqualsDeclaration) {
@@ -918,6 +921,10 @@ namespace ts {
918921

919922
emitJsDocComments(node);
920923
emitModuleElementDeclarationFlags(node);
924+
if (node.flags & NodeFlags.Abstract) {
925+
write("abstract ");
926+
}
927+
921928
write("class ");
922929
writeTextOfNode(currentSourceFile, node.name);
923930
let prevEnclosingDeclaration = enclosingDeclaration;

0 commit comments

Comments
 (0)