Skip to content

Commit 8ce1760

Browse files
committed
Fixing merge conflicts
2 parents bacb9d0 + 5c661ba commit 8ce1760

File tree

308 files changed

+7115
-1564
lines changed

Some content is hidden

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

308 files changed

+7115
-1564
lines changed

Jakefile

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ var servicesSources = [
5757
"services.ts",
5858
"shims.ts",
5959
"signatureHelp.ts",
60-
"utilities.ts"
60+
"utilities.ts",
61+
"navigationBar.ts",
62+
"outliningElementsCollector.ts"
6163
].map(function (f) {
6264
return path.join(servicesDirectory, f);
6365
}));
@@ -126,6 +128,7 @@ function concatenateFiles(destinationFile, sourceFiles) {
126128
}
127129

128130
var useDebugMode = false;
131+
var generateDeclarations = false;
129132
var host = (process.env.host || process.env.TYPESCRIPT_HOST || "node");
130133
var compilerFilename = "tsc.js";
131134
/* Compiles a file from a list of sources
@@ -140,6 +143,9 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu
140143
file(outFile, prereqs, function() {
141144
var dir = useBuiltCompiler ? builtLocalDirectory : LKGDirectory;
142145
var options = "-removeComments --module commonjs -noImplicitAny "; //" -propagateEnumConstants "
146+
if (generateDeclarations) {
147+
options += "--declaration ";
148+
}
143149

144150
var cmd = host + " " + dir + compilerFilename + " " + options + " ";
145151
if (useDebugMode) {
@@ -248,7 +254,7 @@ task("local", ["generate-diagnostics", "lib", tscFile, servicesFile]);
248254
// Local target to build the compiler and services
249255
desc("Emit debug mode files with sourcemaps");
250256
task("debug", function() {
251-
useDebugMode = true;
257+
useDebugMode = true;
252258
});
253259

254260

@@ -262,6 +268,12 @@ task("clean", function() {
262268
jake.rmRf(builtDirectory);
263269
});
264270

271+
// generate declarations for compiler and services
272+
desc("Generate declarations for compiler and services");
273+
task("declaration", function() {
274+
generateDeclarations = true;
275+
});
276+
265277
// Generate Markdown spec
266278
var word2mdJs = path.join(scriptsDirectory, "word2md.js");
267279
var word2mdTs = path.join(scriptsDirectory, "word2md.ts");
@@ -281,12 +293,12 @@ compileFile(word2mdJs,
281293
// The generated spec.md; built for the 'generate-spec' task
282294
file(specMd, [word2mdJs, specWord], function () {
283295
jake.cpR(headerMd, specMd, {silent: true});
284-
var specWordFullPath = path.resolve(specWord);
296+
var specWordFullPath = path.resolve(specWord);
285297
var cmd = "cscript //nologo " + word2mdJs + ' "' + specWordFullPath + '" >>' + specMd;
286-
console.log(cmd);
287-
child_process.exec(cmd, function () {
288-
complete();
289-
});
298+
console.log(cmd);
299+
child_process.exec(cmd, function () {
300+
complete();
301+
});
290302
}, {async: true})
291303

292304

3.81 KB
Binary file not shown.
-69.4 KB
Binary file not shown.

doc/spec.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -581,10 +581,10 @@ For this switch statement, the compiler will generate the following code.
581581

582582
```TypeScript
583583
switch (op) {
584-
case 0 /* Operator.ADD */ :
584+
case 0 /* Operator.ADD */:
585585
// execute add
586586
break;
587-
case 1 /* Operator.DIV */ :
587+
case 1 /* Operator.DIV */:
588588
// execute div
589589
break;
590590
// ...
@@ -738,7 +738,7 @@ var M;
738738
return s;
739739
}
740740
M.f = f;
741-
})(M||(M={}));
741+
})(M || (M = {}));
742742
```
743743

744744
In this case, the compiler assumes that the module object resides in global variable ‘M’, which may or may not have been initialized to the desired module object.
@@ -1068,7 +1068,7 @@ Type references (section [3.6.2](#3.6.2)) to class and interface types are class
10681068

10691069
### <a name="3.3.2"/>3.3.2 Array Types
10701070

1071-
***Array types*** represent JavaScript arrays with a common element type. Array types are named type references created from the generic interface type ‘Array’ in the global module with the array element type as a type argument. Array type literals (section [Error! Reference source not found.](#Error! Reference source not found.)) provide a shorthand notation for creating such references.
1071+
***Array types*** represent JavaScript arrays with a common element type. Array types are named type references created from the generic interface type ‘Array’ in the global module with the array element type as a type argument. Array type literals (section [3.6.4](#3.6.4)) provide a shorthand notation for creating such references.
10721072

10731073
The declaration of the ‘Array’ interface includes a property ‘length’ and a numeric index signature for the element type, along with other members:
10741074

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "typescript",
33
"author": "Microsoft Corp.",
44
"homepage": "http://typescriptlang.org/",
5-
"version": "1.1.0",
5+
"version": "1.3.0",
66
"licenses": [
77
{
88
"type": "Apache License 2.0",

src/compiler/binder.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,13 @@ module ts {
8484
if (node.name) {
8585
node.name.parent = node;
8686
}
87-
file.semanticErrors.push(createDiagnosticForNode(node.name ? node.name : node,
88-
Diagnostics.Duplicate_identifier_0, getDisplayName(node)));
87+
// Report errors every position with duplicate declaration
88+
// Report errors on previous encountered declarations
89+
forEach(symbol.declarations, (declaration) => {
90+
file.semanticErrors.push(createDiagnosticForNode(declaration.name, Diagnostics.Duplicate_identifier_0, getDisplayName(declaration)));
91+
});
92+
file.semanticErrors.push(createDiagnosticForNode(node.name, Diagnostics.Duplicate_identifier_0, getDisplayName(node)));
93+
8994
symbol = createSymbol(0, name);
9095
}
9196
}
@@ -332,7 +337,7 @@ module ts {
332337
break;
333338
case SyntaxKind.SourceFile:
334339
if (isExternalModule(<SourceFile>node)) {
335-
bindAnonymousDeclaration(node, SymbolFlags.ValueModule, '"' + getModuleNameFromFilename((<SourceFile>node).filename) + '"');
340+
bindAnonymousDeclaration(node, SymbolFlags.ValueModule, '"' + removeFileExtension((<SourceFile>node).filename) + '"');
336341
break;
337342
}
338343
default:

0 commit comments

Comments
 (0)