diff --git a/test/language/statements/async-function/let-newline-await-in-async-function.js b/test/language/statements/async-function/let-newline-await-in-async-function.js index c012b8da44..c7a7adb798 100644 --- a/test/language/statements/async-function/let-newline-await-in-async-function.js +++ b/test/language/statements/async-function/let-newline-await-in-async-function.js @@ -5,19 +5,18 @@ author: Jeff Walden esid: sec-let-and-const-declarations description: > - `await` must not be considered a permissible binding name in - LexicalDeclaration as used in async functions. + `let await` does not permit ASI in between, as `await` is a BindingIdentifier info: > - LexicalDeclaration is parametrized to indicate whether `async` is permitted as - binding name. In async functions `await` is excluded from LexicalDeclaration - as a binding name. Therefore ASI *can* apply between `let` (where a - LexicalDeclaration is permitted) and `await`, so a subsequent `0` forms part - of an AwaitExpression and there is no syntax error. + `await` is a perfectly cromulent binding name in any context grammatically, just + prohibited by static semantics in some contexts. Therefore ASI can never apply + between `let` (where a LexicalDeclaration is permitted) and `await`, + so a subsequent `0` where `=` was expected is a syntax error. +negative: + phase: early + type: SyntaxError ---*/ async function f() { let await 0; } - -assert(f instanceof Function); diff --git a/test/language/statements/let/syntax/let-newline-await-in-normal-function.js b/test/language/statements/let/syntax/let-newline-await-in-normal-function.js index 5bb3b9317a..8e35b7fd69 100644 --- a/test/language/statements/let/syntax/let-newline-await-in-normal-function.js +++ b/test/language/statements/let/syntax/let-newline-await-in-normal-function.js @@ -5,14 +5,12 @@ author: Jeff Walden esid: sec-let-and-const-declarations description: > - `await` must be considered a permissible binding name in LexicalDeclaration as - used in non-async functions. + `let await` does not permit ASI in between, as `await` is a BindingIdentifier info: > - LexicalDeclaration is parametrized to indicate whether `async` is permitted as - binding name. In non-async functions `await` is a perfectly cromulent binding - name. Therefore ASI can't apply between `let` (where a LexicalDeclaration is - permitted) and `await`, so a subsequent `0` where `=` was expected is a syntax - error. + `await` is a perfectly cromulent binding name in any context grammatically, just + prohibited by static semantics in some contexts. Therefore ASI can never apply + between `let` (where a LexicalDeclaration is permitted) and `await`, + so a subsequent `0` where `=` was expected is a syntax error. negative: phase: early type: SyntaxError