Debian Codegraph @

js/src/tests/test262/language/expressions/import.meta/syntax/goal-function-params-or-body.js

raw
1 // Copyright (C) 2018 André Bargull. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 esid: sec-left-hand-side-expressions-static-semantics-early-errors
6 description: >
7 An Syntax Error is thrown when the syntactic goal symbol is FunctionBody or FormalParameters.
8 info: |
9 It is an early Syntax Error if Module is not the syntactic goal symbol.
10 features: [import.meta]
11 ---*/
12
13 assert.throws(SyntaxError, function() {
14 Function("import.meta");
15 }, "import.meta in FunctionBody");
16
17 assert.throws(SyntaxError, function() {
18 Function("a = import.meta", "");
19 }, "import.meta in FormalParameters");
20
21 reportCompare(0, 0);