Skip to content

Commit 199b71c

Browse files
committed
Merge branch 'master' into es6Typings
2 parents cc270c7 + bcaba3f commit 199b71c

135 files changed

Lines changed: 4567 additions & 2515 deletions

File tree

Some content is hidden

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

Jakefile

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ function concatenateFiles(destinationFile, sourceFiles) {
138138
}
139139

140140
var useDebugMode = true;
141-
var generateDeclarations = false;
142141
var host = (process.env.host || process.env.TYPESCRIPT_HOST || "node");
143142
var compilerFilename = "tsc.js";
144143
/* Compiles a file from a list of sources
@@ -149,7 +148,7 @@ var compilerFilename = "tsc.js";
149148
* @param useBuiltCompiler: true to use the built compiler, false to use the LKG
150149
* @param noOutFile: true to compile without using --out
151150
*/
152-
function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOutFile) {
151+
function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOutFile, generateDeclarations) {
153152
file(outFile, prereqs, function() {
154153
var dir = useBuiltCompiler ? builtLocalDirectory : LKGDirectory;
155154
var options = "-removeComments --module commonjs -noImplicitAny ";
@@ -160,7 +159,7 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu
160159
if (useDebugMode) {
161160
options += "--preserveConstEnums ";
162161
}
163-
162+
164163
var cmd = host + " " + dir + compilerFilename + " " + options + " ";
165164
cmd = cmd + sources.join(" ") + (!noOutFile ? " -out " + outFile : "");
166165
if (useDebugMode) {
@@ -187,7 +186,7 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu
187186
fs.unlinkSync(outFile);
188187
console.log("Compilation of " + outFile + " unsuccessful");
189188
});
190-
ex.run();
189+
ex.run();
191190
}, {async: true});
192191
}
193192

@@ -242,7 +241,7 @@ file(diagnosticInfoMapTs, [processDiagnosticMessagesJs, diagnosticMessagesJson],
242241
ex.addListener("cmdEnd", function() {
243242
complete();
244243
});
245-
ex.run();
244+
ex.run();
246245
}, {async: true})
247246

248247

@@ -255,7 +254,8 @@ var tscFile = path.join(builtLocalDirectory, compilerFilename);
255254
compileFile(tscFile, compilerSources, [builtLocalDirectory, copyright].concat(compilerSources), [copyright], /*useBuiltCompiler:*/ false);
256255

257256
var servicesFile = path.join(builtLocalDirectory, "typescriptServices.js");
258-
compileFile(servicesFile, servicesSources, [builtLocalDirectory, copyright].concat(servicesSources), [copyright], /*useBuiltCompiler:*/ true);
257+
var servicesDefinitionsFile = path.join(builtLocalDirectory, "typescriptServices.d.ts");
258+
compileFile(servicesFile, servicesSources, [builtLocalDirectory, copyright].concat(servicesSources), [copyright], /*useBuiltCompiler:*/ true, /*noOutFile:*/ false, /*generateDeclarations:*/ true);
259259

260260
// Local target to build the compiler and services
261261
desc("Builds the full compiler and services");
@@ -278,11 +278,6 @@ task("clean", function() {
278278
jake.rmRf(builtDirectory);
279279
});
280280

281-
// generate declarations for compiler and services
282-
desc("Generate declarations for compiler and services");
283-
task("declaration", function() {
284-
generateDeclarations = true;
285-
});
286281

287282
// Generate Markdown spec
288283
var word2mdJs = path.join(scriptsDirectory, "word2md.js");
@@ -317,7 +312,7 @@ task("generate-spec", [specMd])
317312
// Makes a new LKG. This target does not build anything, but errors if not all the outputs are present in the built/local directory
318313
desc("Makes a new LKG out of the built js files");
319314
task("LKG", ["clean", "release", "local"].concat(libraryTargets), function() {
320-
var expectedFiles = [tscFile, servicesFile].concat(libraryTargets);
315+
var expectedFiles = [tscFile, servicesFile, servicesDefinitionsFile].concat(libraryTargets);
321316
var missingFiles = expectedFiles.filter(function (f) {
322317
return !fs.existsSync(f);
323318
});
@@ -559,7 +554,7 @@ file(loggedIOJsPath, [builtLocalDirectory, loggedIOpath], function() {
559554
jake.rmRf(temp);
560555
complete();
561556
});
562-
ex.run();
557+
ex.run();
563558
}, {async: true});
564559

565560
var instrumenterPath = harnessDirectory + 'instrumenter.ts';

bin/lib.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1489,7 +1489,7 @@ interface Uint32Array extends ArrayBufferView {
14891489
set(array: number[], offset?: number): void;
14901490

14911491
/**
1492-
* Gets a new Int8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray.
1492+
* Gets a new Uint32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray.
14931493
* @param begin The index of the beginning of the array.
14941494
* @param end The index of the end of the array.
14951495
*/

src/compiler/binder.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ module ts {
6666
export function bindSourceFile(file: SourceFile) {
6767

6868
var parent: Node;
69-
var container: Declaration;
69+
var container: Node;
7070
var blockScopeContainer: Node;
71-
var lastContainer: Declaration;
71+
var lastContainer: Node;
7272
var symbolCount = 0;
7373
var Symbol = objectAllocator.getSymbolConstructor();
7474

@@ -222,7 +222,7 @@ module ts {
222222

223223
// All container nodes are kept on a linked list in declaration order. This list is used by the getLocalNameOfContainer function
224224
// in the type checker to validate that the local name used for a container is unique.
225-
function bindChildren(node: Declaration, symbolKind: SymbolFlags, isBlockScopeContainer: boolean) {
225+
function bindChildren(node: Node, symbolKind: SymbolFlags, isBlockScopeContainer: boolean) {
226226
if (symbolKind & SymbolFlags.HasLocals) {
227227
node.locals = {};
228228
}
@@ -279,7 +279,7 @@ module ts {
279279
break;
280280
}
281281
case SyntaxKind.TypeLiteral:
282-
case SyntaxKind.ObjectLiteral:
282+
case SyntaxKind.ObjectLiteralExpression:
283283
case SyntaxKind.InterfaceDeclaration:
284284
declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes);
285285
break;
@@ -341,7 +341,7 @@ module ts {
341341
typeLiteralSymbol.members[node.kind === SyntaxKind.FunctionType ? "__call" : "__new"] = symbol
342342
}
343343

344-
function bindAnonymousDeclaration(node: Node, symbolKind: SymbolFlags, name: string, isBlockScopeContainer: boolean) {
344+
function bindAnonymousDeclaration(node: Declaration, symbolKind: SymbolFlags, name: string, isBlockScopeContainer: boolean) {
345345
var symbol = createSymbol(symbolKind, name);
346346
addDeclarationToSymbol(symbol, node, symbolKind);
347347
bindChildren(node, symbolKind, isBlockScopeContainer);
@@ -434,14 +434,14 @@ module ts {
434434
break;
435435

436436
case SyntaxKind.TypeLiteral:
437-
bindAnonymousDeclaration(node, SymbolFlags.TypeLiteral, "__type", /*isBlockScopeContainer*/ false);
437+
bindAnonymousDeclaration(<TypeLiteralNode>node, SymbolFlags.TypeLiteral, "__type", /*isBlockScopeContainer*/ false);
438438
break;
439-
case SyntaxKind.ObjectLiteral:
440-
bindAnonymousDeclaration(node, SymbolFlags.ObjectLiteral, "__object", /*isBlockScopeContainer*/ false);
439+
case SyntaxKind.ObjectLiteralExpression:
440+
bindAnonymousDeclaration(<ObjectLiteralExpression>node, SymbolFlags.ObjectLiteral, "__object", /*isBlockScopeContainer*/ false);
441441
break;
442442
case SyntaxKind.FunctionExpression:
443443
case SyntaxKind.ArrowFunction:
444-
bindAnonymousDeclaration(node, SymbolFlags.Function, "__function", /*isBlockScopeContainer*/ true);
444+
bindAnonymousDeclaration(<FunctionExpression>node, SymbolFlags.Function, "__function", /*isBlockScopeContainer*/ true);
445445
break;
446446
case SyntaxKind.CatchBlock:
447447
bindCatchVariableDeclaration(<CatchBlock>node);
@@ -471,7 +471,7 @@ module ts {
471471
break;
472472
case SyntaxKind.SourceFile:
473473
if (isExternalModule(<SourceFile>node)) {
474-
bindAnonymousDeclaration(node, SymbolFlags.ValueModule, '"' + removeFileExtension((<SourceFile>node).filename) + '"', /*isBlockScopeContainer*/ true);
474+
bindAnonymousDeclaration(<SourceFile>node, SymbolFlags.ValueModule, '"' + removeFileExtension((<SourceFile>node).filename) + '"', /*isBlockScopeContainer*/ true);
475475
break;
476476
}
477477

0 commit comments

Comments
 (0)