Debian Codegraph @

js/src/tests/test262/language/module-code/top-level-await/syntax/early-does-not-propagate-to-fn-expr-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 expression
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 FunctionExpression:
17 function BindingIdentifier[~Yield, ~Await]_opt ( FormalParameters[~Yield, ~Await] )
18 { FunctionBody[~Yield, ~Await] }
19 negative:
20 phase: parse
21 type: SyntaxError
22 esid: prod-ModuleItem
23 flags: [module]
24 features: [top-level-await]
25 ---*/
26
27 $DONOTEVALUATE();
28
29 0, function () {
30 await 1;
31 };