Debian Codegraph @

js/src/jit-test/tests/modules/bad-namespace-created.js

raw
1 // Prior to https://github.com/tc39/ecma262/pull/916 it was possible for a
2 // module namespace object to be successfully created that was later found to be
3 // erroneous. Test that this is no longer the case.
4
5 "use strict";
6
7 load(libdir + "asserts.js");
8
9 let a = registerModule('A', parseModule('import "B"; export {x} from "C"'));
10 registerModule('B', parseModule('import * as a from "A"'));
11 registerModule('C', parseModule('export * from "D"; export * from "E"'));
12 registerModule('D', parseModule('export let x'));
13 registerModule('E', parseModule('export let x'));
14
15 assertThrowsInstanceOf(() => moduleLink(a), SyntaxError);