mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-23 07:07:09 -05:00
Disable computed properties in TypeScript 1.4
Conflicts: src/compiler/diagnosticInformationMap.generated.ts src/compiler/diagnosticMessages.json
This commit is contained in:
@@ -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 },
|
||||
};
|
||||
}
|
||||
@@ -1826,5 +1826,9 @@
|
||||
"category": "Error",
|
||||
"code": 9001,
|
||||
"isEarly": true
|
||||
},
|
||||
"Computed property names are not currently supported.": {
|
||||
"category": "Error",
|
||||
"code": 9002,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user