Disable symbol indexer

This commit is contained in:
Jason Freeman
2015-02-06 21:33:01 -08:00
parent 2f3c32afd6
commit eb5061971d
32 changed files with 154 additions and 156 deletions
+1 -9
View File
@@ -10651,15 +10651,7 @@ module ts {
return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_must_have_a_type_annotation);
}
if (parameter.type.kind !== SyntaxKind.StringKeyword && parameter.type.kind !== SyntaxKind.NumberKeyword) {
if (parameter.type.kind === SyntaxKind.SymbolKeyword) {
if (languageVersion < ScriptTarget.ES6) {
return grammarErrorOnNode(parameter.type, Diagnostics.symbol_indexers_are_only_available_when_targeting_ECMAScript_6_and_higher);
}
// No error for parameter type
}
else {
return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_type_must_be_string_number_or_symbol);
}
return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_type_must_be_string_or_number);
}
if (!node.type) {
return grammarErrorOnNode(node, Diagnostics.An_index_signature_must_have_a_type_annotation);
@@ -19,7 +19,7 @@ module ts {
An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: DiagnosticCategory.Error, key: "An index signature parameter cannot have an initializer." },
An_index_signature_must_have_a_type_annotation: { code: 1021, category: DiagnosticCategory.Error, key: "An index signature must have a type annotation." },
An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: DiagnosticCategory.Error, key: "An index signature parameter must have a type annotation." },
An_index_signature_parameter_type_must_be_string_number_or_symbol: { code: 1023, category: DiagnosticCategory.Error, key: "An index signature parameter type must be 'string', 'number', or 'symbol'." },
An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: DiagnosticCategory.Error, key: "An index signature parameter type must be 'string' or 'number'." },
A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: DiagnosticCategory.Error, key: "A class or interface declaration can only have one 'extends' clause." },
An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: DiagnosticCategory.Error, key: "An 'extends' clause must precede an 'implements' clause." },
A_class_can_only_extend_a_single_class: { code: 1026, category: DiagnosticCategory.Error, key: "A class can only extend a single class." },
@@ -147,7 +147,6 @@ module ts {
Merge_conflict_marker_encountered: { code: 1185, category: DiagnosticCategory.Error, key: "Merge conflict marker encountered." },
A_rest_element_cannot_have_an_initializer: { code: 1186, category: DiagnosticCategory.Error, key: "A rest element cannot have an initializer." },
A_parameter_property_may_not_be_a_binding_pattern: { code: 1187, category: DiagnosticCategory.Error, key: "A parameter property may not be a binding pattern." },
symbol_indexers_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1188, category: DiagnosticCategory.Error, key: "'symbol' indexers are only available when targeting ECMAScript 6 and higher.", isEarly: true },
Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
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." },
Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },
+1 -6
View File
@@ -67,7 +67,7 @@
"category": "Error",
"code": 1022
},
"An index signature parameter type must be 'string', 'number', or 'symbol'.": {
"An index signature parameter type must be 'string' or 'number'.": {
"category": "Error",
"code": 1023
},
@@ -579,11 +579,6 @@
"category": "Error",
"code": 1187
},
"'symbol' indexers are only available when targeting ECMAScript 6 and higher.": {
"category": "Error",
"code": 1188,
"isEarly": true
},
"Duplicate identifier '{0}'.": {
"category": "Error",