Debian Codegraph @

js/src/tests/test262/language/statements/let/syntax/let-newline-yield-in-normal-function.js

raw
1 // |reftest| error:SyntaxError
2 // Copyright (C) 2017 the V8 project authors. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 esid: sec-let-and-const-declarations
7 description: >
8 `let yield` does not permit ASI in between, as `yield` is a BindingIdentifier
9 info: |
10 `yield` is a perfectly cromulent binding name in any context grammatically, just
11 prohibited by static semantics in some contexts. Therefore ASI can never apply
12 between `let` (where a LexicalDeclaration is permitted) and `yield`,
13 so a subsequent `0` where `=` was expected is a syntax error.
14 negative:
15 phase: parse
16 type: SyntaxError
17 ---*/
18
19 $DONOTEVALUATE();
20
21 function f() {
22 let
23 yield 0;
24 }