Disable computed properties in TypeScript 1.4

Conflicts:
	src/compiler/diagnosticInformationMap.generated.ts
	src/compiler/diagnosticMessages.json
This commit is contained in:
Jason Freeman
2014-12-11 16:49:24 -08:00
committed by Yui T
parent 04c9cbfbd4
commit 867e2a8b6f
49 changed files with 167 additions and 319 deletions

View File

@@ -435,5 +435,6 @@ module ts {
You_cannot_rename_this_element: { code: 8000, category: DiagnosticCategory.Error, key: "You cannot rename this element." },
yield_expressions_are_not_currently_supported: { code: 9000, category: DiagnosticCategory.Error, key: "'yield' expressions are not currently supported.", isEarly: true },
generators_are_not_currently_supported: { code: 9001, category: DiagnosticCategory.Error, key: "'generators' are not currently supported.", isEarly: true },
Computed_property_names_are_not_currently_supported: { code: 9002, category: DiagnosticCategory.Error, key: "Computed property names are not currently supported.", isEarly: true },
};
}

View File

@@ -1826,5 +1826,9 @@
"category": "Error",
"code": 9001,
"isEarly": true
},
"Computed property names are not currently supported.": {
"category": "Error",
"code": 9002,
}
}

View File

@@ -5552,6 +5552,10 @@ module ts {
}
function checkComputedPropertyName(node: ComputedPropertyName) {
// Since computed properties are not supported in the type checker, disallow them in TypeScript 1.4
// Once full support is added, remove this error.
return grammarErrorOnNode(node, Diagnostics.Computed_property_names_are_not_currently_supported);
if (languageVersion < ScriptTarget.ES6) {
return grammarErrorOnNode(node, Diagnostics.Computed_property_names_are_only_available_when_targeting_ECMAScript_6_and_higher);
}