Debian Codegraph @

js/src/tests/test262/language/expressions/import.meta/syntax/goal-generator-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 GeneratorBody or FormalParameters.
8 info: |
9 It is an early Syntax Error if Module is not the syntactic goal symbol.
10 features: [import.meta, generators]
11 ---*/
12
13 var Generator = function*(){}.constructor;
14
15 assert.throws(SyntaxError, function() {
16 Generator("import.meta");
17 }, "import.meta in GeneratorBody");
18
19 assert.throws(SyntaxError, function() {
20 Generator("a = import.meta", "");
21 }, "import.meta in FormalParameters");
22
23 reportCompare(0, 0);