Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/statements/let/syntax/let-newline-yield-in-generator-function.js

raw
1 // Copyright (C) 2017 Mozilla Corporation. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 author: Jeff Walden <[email protected]>
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 features: [generators]
18 ---*/
19
20 throw "Test262: This statement should not be evaluated.";
21
22 function* f() {
23 let
24 yield 0;
25 }