mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Disable computed properties in TypeScript 1.4
This commit is contained in:
@@ -431,5 +431,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." },
|
||||
generators_are_not_currently_supported: { code: 9001, category: DiagnosticCategory.Error, key: "'generators' are not currently supported." },
|
||||
Computed_property_names_are_not_currently_supported: { code: 9002, category: DiagnosticCategory.Error, key: "Computed property names are not currently supported." },
|
||||
};
|
||||
}
|
||||
@@ -1723,5 +1723,9 @@
|
||||
"'generators' are not currently supported.": {
|
||||
"category": "Error",
|
||||
"code": 9001
|
||||
},
|
||||
"Computed property names are not currently supported.": {
|
||||
"category": "Error",
|
||||
"code": 9002
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4901,6 +4901,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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user