Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 48c6bdb

Browse filesBrowse files
Merge branch 'master' into printDiagnosticCodes
2 parents 7f4ae93 + eb41b21 commit 48c6bdb
Copy full SHA for 48c6bdb

41 files changed

+1,211-1,001Lines changed: 1211 additions & 1001 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/compiler/core.ts‎

Copy file name to clipboardExpand all lines: src/compiler/core.ts
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,11 @@ module ts {
188188

189189
export var localizedDiagnosticMessages: Map<string> = undefined;
190190

191-
function getLocaleSpecificMessage(message: string) {
191+
export function getLocaleSpecificMessage(message: string) {
192192
if (ts.localizedDiagnosticMessages) {
193193
message = localizedDiagnosticMessages[message];
194194
}
195195

196-
/* Check to see that we got an actual value back. */
197-
Debug.assert(message, "Diagnostic message does not exist in locale map.");
198-
199196
return message;
200197
}
201198

Collapse file

‎src/compiler/diagnosticInformationMap.generated.ts‎

Copy file name to clipboardExpand all lines: src/compiler/diagnosticInformationMap.generated.ts
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ module ts {
111111
Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: DiagnosticCategory.Error, key: "Import declarations in an internal module cannot reference an external module." },
112112
Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: DiagnosticCategory.Error, key: "Cannot compile external modules unless the '--module' flag is provided." },
113113
Filename_0_differs_from_already_included_filename_1_only_in_casing: { code: 1149, category: DiagnosticCategory.Error, key: "Filename '{0}' differs from already included filename '{1}' only in casing" },
114-
new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 2068, category: DiagnosticCategory.Error, key: "'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead." },
114+
new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: DiagnosticCategory.Error, key: "'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead." },
115115
Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
116116
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." },
117117
Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },
@@ -389,5 +389,6 @@ module ts {
389389
Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: DiagnosticCategory.Error, key: "Object literal's property '{0}' implicitly has an '{1}' type." },
390390
Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: DiagnosticCategory.Error, key: "Rest parameter '{0}' implicitly has an 'any[]' type." },
391391
Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: DiagnosticCategory.Error, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." },
392+
You_cannot_rename_this_element: { code: 8000, category: DiagnosticCategory.Error, key: "You cannot rename this element." },
392393
};
393394
}
Collapse file

‎src/compiler/diagnosticMessages.json‎

Copy file name to clipboardExpand all lines: src/compiler/diagnosticMessages.json
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1355,7 +1355,6 @@
13551355
"category": "Error",
13561356
"code": 5039
13571357
},
1358-
13591358
"Concatenate and emit output to single file.": {
13601359
"category": "Message",
13611360
"code": 6001
@@ -1552,5 +1551,9 @@
15521551
"Call signature, which lacks return-type annotation, implicitly has an 'any' return type.": {
15531552
"category": "Error",
15541553
"code": 7020
1554+
},
1555+
"You cannot rename this element.": {
1556+
"category": "Error",
1557+
"code": 8000
15551558
}
15561559
}
Collapse file

‎src/compiler/parser.ts‎

Copy file name to clipboardExpand all lines: src/compiler/parser.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module ts {
99
export function getNodeConstructor(kind: SyntaxKind): new () => Node {
1010
return nodeConstructors[kind] || (nodeConstructors[kind] = objectAllocator.getNodeConstructor(kind));
1111
}
12-
12+
1313
function createRootNode(kind: SyntaxKind, pos: number, end: number, flags: NodeFlags): Node {
1414
var node = new (getNodeConstructor(kind))();
1515
node.pos = pos;
@@ -443,7 +443,7 @@ module ts {
443443
nodeIsNestedInLabel(label: Identifier, requireIterationStatement: boolean, stopAtFunctionBoundary: boolean): ControlBlockContext;
444444
}
445445

446-
export function createSourceFile(filename: string, sourceText: string, languageVersion: ScriptTarget, version: number = 0, isOpen: boolean = false): SourceFile {
446+
export function createSourceFile(filename: string, sourceText: string, languageVersion: ScriptTarget, version: string, isOpen: boolean = false): SourceFile {
447447
var file: SourceFile;
448448
var scanner: Scanner;
449449
var token: SyntaxKind;
Collapse file

‎src/compiler/tsc.ts‎

Copy file name to clipboardExpand all lines: src/compiler/tsc.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ module ts {
147147
}
148148
text = "";
149149
}
150-
return text !== undefined ? createSourceFile(filename, text, languageVersion) : undefined;
150+
return text !== undefined ? createSourceFile(filename, text, languageVersion, /*version:*/ "0") : undefined;
151151
}
152152

153153
function writeFile(fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void) {
Collapse file

‎src/compiler/types.ts‎

Copy file name to clipboardExpand all lines: src/compiler/types.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ module ts {
535535
identifierCount: number;
536536
symbolCount: number;
537537
isOpen: boolean;
538-
version: number;
538+
version: string;
539539
languageVersion: ScriptTarget;
540540
}
541541

Collapse file

‎src/harness/compilerRunner.ts‎

Copy file name to clipboardExpand all lines: src/harness/compilerRunner.ts
+29-8Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,19 +183,40 @@ class CompilerBaselineRunner extends RunnerBase {
183183

184184
// if the .d.ts is non-empty, confirm it compiles correctly as well
185185
if (options.declaration && result.errors.length === 0 && result.declFilesCode.length > 0) {
186-
function getDtsFile(file: { unitName: string; content: string }) {
186+
function addDtsFile(file: { unitName: string; content: string }, dtsFiles: { unitName: string; content: string }[]) {
187187
if (Harness.Compiler.isDTS(file.unitName)) {
188-
return file;
189-
} else {
190-
var declFile = ts.forEach(result.declFilesCode,
191-
declFile => declFile.fileName === (file.unitName.substr(0, file.unitName.length - ".ts".length) + ".d.ts")
188+
dtsFiles.push(file);
189+
}
190+
else {
191+
var declFile = findResultCodeFile(file.unitName);
192+
// Look if there is --out file corresponding to this ts file
193+
if (!declFile && options.out) {
194+
declFile = findResultCodeFile(options.out);
195+
if (!declFile || findUnit(declFile.fileName, declToBeCompiled) ||
196+
findUnit(declFile.fileName, declOtherFiles)) {
197+
return;
198+
}
199+
}
200+
201+
if (declFile) {
202+
dtsFiles.push({ unitName: declFile.fileName, content: declFile.code });
203+
return;
204+
}
205+
}
206+
207+
function findResultCodeFile(fileName: string) {
208+
return ts.forEach(result.declFilesCode,
209+
declFile => declFile.fileName === (fileName.substr(0, fileName.length - ".ts".length) + ".d.ts")
192210
? declFile : undefined);
193-
return { unitName: declFile.fileName, content: declFile.code };
211+
}
212+
213+
function findUnit(fileName: string, units: { unitName: string; content: string }[]) {
214+
return ts.forEach(units, unit => unit.unitName === fileName ? unit : undefined);
194215
}
195216
}
196217

197-
ts.forEach(toBeCompiled, file => { declToBeCompiled.push(getDtsFile(file)); });
198-
ts.forEach(otherFiles, file => { declOtherFiles.push(getDtsFile(file)); });
218+
ts.forEach(toBeCompiled, file => addDtsFile(file, declToBeCompiled));
219+
ts.forEach(otherFiles, file => addDtsFile(file, declOtherFiles));
199220
harnessCompiler.compileFiles(declToBeCompiled, declOtherFiles, function (compileResult) {
200221
declResult = compileResult;
201222
}, function (settings) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.