Debian Codegraph @

js/src/tests/test262/language/module-code/top-level-await/syntax/early-does-not-propagate-to-fn-declaration-body.js

raw
1 // |reftest| error:SyntaxError module
2 // Copyright (C) 2019 Leo Balter. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 description: >
7 The Await capability does not propagate to the body of a function declaration
8 info: |
9 ModuleItem:
10 StatementListItem[~Yield, +Await, ~Return]
11
12 StatementListItem[Yield, Await, Return]:
13 Statement[?Yield, ?Await, ?Return]
14 Declaration[?Yield, ?Await]
15
16 Declaration[Yield, Await]:
17 HoistableDeclaration[?Yield, ?Await, ~Default]
18 ClassDeclaration[?Yield, ?Await, ~Default]
19 LexicalDeclaration[+In, ?Yield, ?Await]
20
21 HoistableDeclaration[Yield, Await, Default]:
22 FunctionDeclaration[?Yield, ?Await, ?Default]
23 GeneratorDeclaration[?Yield, ?Await, ?Default]
24 AsyncFunctionDeclaration[?Yield, ?Await, ?Default]
25 AsyncGeneratorDeclaration[?Yield, ?Await, ?Default]
26
27 FunctionDeclaration[Yield, Await, Default]:
28 function BindingIdentifier[?Yield, ?Await] ( FormalParameters[~Yield, ~Await] ) { FunctionBody[~Yield, ~Await] }
29 negative:
30 phase: parse
31 type: SyntaxError
32 esid: prod-ModuleItem
33 flags: [module]
34 features: [top-level-await]
35 ---*/
36
37 $DONOTEVALUATE();
38
39 function fn() { await 0; }