Skip to content

Commit c6b50cd

Browse files
author
Yui T
committed
Merge branch 'master' into increaseRWCTimeout
2 parents 246ff09 + 6d7045e commit c6b50cd

644 files changed

Lines changed: 13607 additions & 1382 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: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ var child_process = require("child_process");
88
// Variables
99
var compilerDirectory = "src/compiler/";
1010
var servicesDirectory = "src/services/";
11+
var serverDirectory = "src/server/";
1112
var harnessDirectory = "src/harness/";
1213
var libraryDirectory = "src/lib/";
1314
var scriptsDirectory = "scripts/";
@@ -90,6 +91,16 @@ var servicesSources = [
9091
return path.join(servicesDirectory, f);
9192
}));
9293

94+
var serverSources = [
95+
"node.d.ts",
96+
"editorServices.ts",
97+
"protocol.d.ts",
98+
"session.ts",
99+
"server.ts"
100+
].map(function (f) {
101+
return path.join(serverDirectory, f);
102+
});
103+
93104
var definitionsRoots = [
94105
"compiler/types.d.ts",
95106
"compiler/scanner.d.ts",
@@ -130,6 +141,13 @@ var harnessSources = [
130141
"services/preProcessFile.ts"
131142
].map(function (f) {
132143
return path.join(unittestsDirectory, f);
144+
})).concat([
145+
"protocol.d.ts",
146+
"session.ts",
147+
"client.ts",
148+
"editorServices.ts",
149+
].map(function (f) {
150+
return path.join(serverDirectory, f);
133151
}));
134152

135153
var librarySourceMap = [
@@ -327,6 +345,7 @@ var tscFile = path.join(builtLocalDirectory, compilerFilename);
327345
compileFile(tscFile, compilerSources, [builtLocalDirectory, copyright].concat(compilerSources), [copyright], /*useBuiltCompiler:*/ false);
328346

329347
var servicesFile = path.join(builtLocalDirectory, "typescriptServices.js");
348+
var nodePackageFile = path.join(builtLocalDirectory, "typescript.js");
330349
compileFile(servicesFile, servicesSources,[builtLocalDirectory, copyright].concat(servicesSources),
331350
/*prefixes*/ [copyright],
332351
/*useBuiltCompiler*/ true,
@@ -336,7 +355,10 @@ compileFile(servicesFile, servicesSources,[builtLocalDirectory, copyright].conca
336355
/*preserveConstEnums*/ true,
337356
/*keepComments*/ false,
338357
/*noResolve*/ false,
339-
/*stripInternal*/ false);
358+
/*stripInternal*/ false,
359+
/*callback*/ function () {
360+
jake.cpR(servicesFile, nodePackageFile, {silent: true});
361+
});
340362

341363
var nodeDefinitionsFile = path.join(builtLocalDirectory, "typescript.d.ts");
342364
var standaloneDefinitionsFile = path.join(builtLocalDirectory, "typescriptServices.d.ts");
@@ -378,9 +400,12 @@ compileFile(nodeDefinitionsFile, servicesSources,[builtLocalDirectory, copyright
378400
jake.rmRf(tempDirPath, {silent: true});
379401
});
380402

403+
var serverFile = path.join(builtLocalDirectory, "tsserver.js");
404+
compileFile(serverFile, serverSources,[builtLocalDirectory, copyright].concat(serverSources), /*prefixes*/ [copyright], /*useBuiltCompiler*/ true);
405+
381406
// Local target to build the compiler and services
382407
desc("Builds the full compiler and services");
383-
task("local", ["generate-diagnostics", "lib", tscFile, servicesFile, nodeDefinitionsFile]);
408+
task("local", ["generate-diagnostics", "lib", tscFile, servicesFile, nodeDefinitionsFile, serverFile]);
384409

385410
// Local target to build only tsc.js
386411
desc("Builds only the compiler");
@@ -435,7 +460,7 @@ task("generate-spec", [specMd])
435460
// Makes a new LKG. This target does not build anything, but errors if not all the outputs are present in the built/local directory
436461
desc("Makes a new LKG out of the built js files");
437462
task("LKG", ["clean", "release", "local"].concat(libraryTargets), function() {
438-
var expectedFiles = [tscFile, servicesFile, nodeDefinitionsFile, standaloneDefinitionsFile, internalNodeDefinitionsFile, internalStandaloneDefinitionsFile].concat(libraryTargets);
463+
var expectedFiles = [tscFile, servicesFile, nodePackageFile, nodeDefinitionsFile, standaloneDefinitionsFile, internalNodeDefinitionsFile, internalStandaloneDefinitionsFile].concat(libraryTargets);
439464
var missingFiles = expectedFiles.filter(function (f) {
440465
return !fs.existsSync(f);
441466
});

bin/tsserver

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env node
2+
require('./tsserver.js')

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@
2525
"url": "https://github.com/Microsoft/TypeScript.git"
2626
},
2727
"preferGlobal": true,
28-
"main": "./bin/typescriptServices.js",
28+
"main": "./bin/typescript.js",
2929
"bin": {
30-
"tsc": "./bin/tsc"
30+
"tsc": "./bin/tsc",
31+
"tsserver": "./bin/tsserver"
3132
},
3233
"engines": {
3334
"node": ">=0.8.0"

src/compiler/binder.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,6 @@ module ts {
5151
}
5252
}
5353

54-
/**
55-
* A declaration has a dynamic name if both of the following are true:
56-
* 1. The declaration has a computed property name
57-
* 2. The computed name is *not* expressed as Symbol.<name>, where name
58-
* is a property of the Symbol constructor that denotes a built in
59-
* Symbol.
60-
*/
61-
export function hasDynamicName(declaration: Declaration): boolean {
62-
return declaration.name && declaration.name.kind === SyntaxKind.ComputedPropertyName;
63-
}
64-
6554
export function bindSourceFile(file: SourceFile): void {
6655
var start = new Date().getTime();
6756
bindSourceFileWorker(file);
@@ -98,13 +87,18 @@ module ts {
9887
if (symbolKind & SymbolFlags.Value && !symbol.valueDeclaration) symbol.valueDeclaration = node;
9988
}
10089

101-
// Should not be called on a declaration with a computed property name.
90+
// Should not be called on a declaration with a computed property name,
91+
// unless it is a well known Symbol.
10292
function getDeclarationName(node: Declaration): string {
10393
if (node.name) {
10494
if (node.kind === SyntaxKind.ModuleDeclaration && node.name.kind === SyntaxKind.StringLiteral) {
10595
return '"' + (<LiteralExpression>node.name).text + '"';
10696
}
107-
Debug.assert(!hasDynamicName(node));
97+
if (node.name.kind === SyntaxKind.ComputedPropertyName) {
98+
var nameExpression = (<ComputedPropertyName>node.name).expression;
99+
Debug.assert(isWellKnownSymbolSyntactically(nameExpression));
100+
return getPropertyNameForKnownSymbolName((<PropertyAccessExpression>nameExpression).name.text);
101+
}
108102
return (<Identifier | LiteralExpression>node.name).text;
109103
}
110104
switch (node.kind) {
@@ -495,6 +489,7 @@ module ts {
495489
case SyntaxKind.CatchClause:
496490
case SyntaxKind.ForStatement:
497491
case SyntaxKind.ForInStatement:
492+
case SyntaxKind.ForOfStatement:
498493
case SyntaxKind.SwitchStatement:
499494
bindChildren(node, 0, /*isBlockScopeContainer*/ true);
500495
break;

0 commit comments

Comments
 (0)