Debian Codegraph @

js/src/tests/test262/language/eval-code/indirect/import.js

raw
1 // |reftest| module
2 // Copyright (C) 2016 the V8 project authors. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 description: The `import` declaration may not appear within eval code
6 esid: sec-scripts
7 flags: [module]
8 info: |
9 Eval code is the source text supplied to the built-in eval function. More
10 precisely, if the parameter to the built-in eval function is a String, it
11 is treated as an ECMAScript Script. The eval code for a particular
12 invocation of eval is the global code portion of that Script.
13
14 A.5 Scripts and Modules
15
16 Script:
17 ScriptBodyopt
18
19 ScriptBody:
20 StatementList
21 ---*/
22
23 assert.throws(SyntaxError, function() {
24 (0,eval)('import v from "./import.js";');
25 });
26
27 reportCompare(0, 0);