mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Added es5 conformance tests for async arrow functions, add error for referencing 'arguments' in a generator.
This commit is contained in:
@@ -8162,10 +8162,13 @@ namespace ts {
|
||||
// can explicitly bound arguments objects
|
||||
if (symbol === argumentsSymbol) {
|
||||
const container = getContainingFunction(node);
|
||||
if (container.kind === SyntaxKind.ArrowFunction) {
|
||||
if (languageVersion < ScriptTarget.ES6) {
|
||||
if (languageVersion < ScriptTarget.ES6) {
|
||||
if (container.kind === SyntaxKind.ArrowFunction) {
|
||||
error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression);
|
||||
}
|
||||
else if (hasModifier(container, ModifierFlags.Async)) {
|
||||
error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method);
|
||||
}
|
||||
}
|
||||
|
||||
if (node.flags & NodeFlags.AwaitContext) {
|
||||
|
||||
@@ -1695,7 +1695,7 @@
|
||||
"category": "Error",
|
||||
"code": 2521
|
||||
},
|
||||
"The 'arguments' object cannot be referenced in an async arrow function. Consider using a standard async function expression.": {
|
||||
"The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method.": {
|
||||
"category": "Error",
|
||||
"code": 2522
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user