mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-19 00:42:28 -05:00
Cleaned up diagnostic messages
This commit is contained in:
@@ -7635,7 +7635,7 @@ module ts {
|
||||
function checkAwaitExpression(node: AwaitExpression): Type {
|
||||
// Grammar checking
|
||||
if (!(node.parserContextFlags & ParserContextFlags.Await)) {
|
||||
grammarErrorOnFirstToken(node, Diagnostics.await_expression_must_be_contained_within_an_async_function);
|
||||
grammarErrorOnFirstToken(node, Diagnostics.await_expression_is_only_allowed_within_an_async_function);
|
||||
}
|
||||
|
||||
let operandType = checkExpression(node.expression);
|
||||
@@ -10069,6 +10069,9 @@ module ts {
|
||||
if (node.parserContextFlags & ParserContextFlags.StrictMode) {
|
||||
grammarErrorOnFirstToken(node, Diagnostics.with_statements_are_not_allowed_in_strict_mode);
|
||||
}
|
||||
else if (node.parserContextFlags & ParserContextFlags.Await) {
|
||||
grammarErrorOnFirstToken(node, Diagnostics.with_statements_are_not_allowed_in_an_async_function_block);
|
||||
}
|
||||
}
|
||||
|
||||
checkExpression(node.expression);
|
||||
|
||||
@@ -181,16 +181,7 @@ module ts {
|
||||
Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1216, category: DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." },
|
||||
Export_assignment_is_not_supported_when_module_flag_is_system: { code: 1218, category: DiagnosticCategory.Error, key: "Export assignment is not supported when '--module' flag is 'system'." },
|
||||
with_statements_are_not_allowed_in_an_async_function_block: { code: 1300, category: DiagnosticCategory.Error, key: "'with' statements are not allowed in an async function block." },
|
||||
_0_modifier_cannot_be_used_with_a_generator: { code: 1301, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot be used with a generator." },
|
||||
_0_modifier_cannot_be_used_with_a_module_declaration: { code: 1302, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot be used with a module declaration." },
|
||||
_0_modifier_cannot_be_used_with_an_enum_declaration: { code: 1303, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot be used with an enum declaration." },
|
||||
_0_modifier_cannot_be_used_with_an_export_assignment_declaration: { code: 1304, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot be used with an export assignment declaration." },
|
||||
_0_modifier_cannot_be_used_on_a_variable_statement: { code: 1305, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot be used on a variable statement." },
|
||||
_0_modifier_cannot_be_used_with_a_type_declaration: { code: 1306, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot be used with a type declaration." },
|
||||
_0_modifier_cannot_be_used_with_a_parameter_declaration: { code: 1307, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot be used with a parameter declaration." },
|
||||
await_expression_must_be_contained_within_an_async_function: { code: 1308, category: DiagnosticCategory.Error, key: "'await' expression must be contained within an async function." },
|
||||
_0_modifier_cannot_be_used_on_an_object_literal_element: { code: 1309, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot be used on an object literal element." },
|
||||
_0_expression_is_not_allowed_in_an_initializer: { code: 1310, category: DiagnosticCategory.Error, key: "'{0}' expression is not allowed in an initializer." },
|
||||
await_expression_is_only_allowed_within_an_async_function: { code: 1308, category: DiagnosticCategory.Error, key: "'await' expression is only allowed within an async function." },
|
||||
Async_functions_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1311, category: DiagnosticCategory.Error, key: "Async functions are only available when targeting ECMAScript 6 and higher." },
|
||||
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." },
|
||||
|
||||
@@ -712,46 +712,10 @@
|
||||
"category": "Error",
|
||||
"code": 1300
|
||||
},
|
||||
"'{0}' modifier cannot be used with a generator.": {
|
||||
"category": "Error",
|
||||
"code": 1301
|
||||
},
|
||||
"'{0}' modifier cannot be used with a module declaration.": {
|
||||
"category": "Error",
|
||||
"code": 1302
|
||||
},
|
||||
"'{0}' modifier cannot be used with an enum declaration.": {
|
||||
"category": "Error",
|
||||
"code": 1303
|
||||
},
|
||||
"'{0}' modifier cannot be used with an export assignment declaration.": {
|
||||
"category": "Error",
|
||||
"code": 1304
|
||||
},
|
||||
"'{0}' modifier cannot be used on a variable statement.": {
|
||||
"category": "Error",
|
||||
"code": 1305
|
||||
},
|
||||
"'{0}' modifier cannot be used with a type declaration.": {
|
||||
"category": "Error",
|
||||
"code": 1306
|
||||
},
|
||||
"'{0}' modifier cannot be used with a parameter declaration.": {
|
||||
"category": "Error",
|
||||
"code": 1307
|
||||
},
|
||||
"'await' expression must be contained within an async function.": {
|
||||
"'await' expression is only allowed within an async function.": {
|
||||
"category": "Error",
|
||||
"code": 1308
|
||||
},
|
||||
"'{0}' modifier cannot be used on an object literal element.": {
|
||||
"category": "Error",
|
||||
"code": 1309
|
||||
},
|
||||
"'{0}' expression is not allowed in an initializer.": {
|
||||
"category": "Error",
|
||||
"code": 1310
|
||||
},
|
||||
"Async functions are only available when targeting ECMAScript 6 and higher.": {
|
||||
"category": "Error",
|
||||
"code": 1311
|
||||
|
||||
Reference in New Issue
Block a user