mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 16:25:38 +00:00
Bug 1689499 - Add test to show cycle issue with multiple parents;r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D103787
This commit is contained in:
parent
c86b10a91e
commit
febe527fc3
5
js/src/tests/non262/module/bug1689499-a.js
Normal file
5
js/src/tests/non262/module/bug1689499-a.js
Normal file
@ -0,0 +1,5 @@
|
||||
// |reftest| skip -- support file
|
||||
|
||||
import B from "./bug1689499-b.js";
|
||||
import C from "./bug1689499-c.js";
|
||||
export default "A";
|
6
js/src/tests/non262/module/bug1689499-b.js
Normal file
6
js/src/tests/non262/module/bug1689499-b.js
Normal file
@ -0,0 +1,6 @@
|
||||
// |reftest| skip -- support file
|
||||
|
||||
import A from "./bug1689499-a.js";
|
||||
if (true) await 0;
|
||||
export default "B";
|
||||
|
8
js/src/tests/non262/module/bug1689499-c.js
Normal file
8
js/src/tests/non262/module/bug1689499-c.js
Normal file
@ -0,0 +1,8 @@
|
||||
// |reftest| skip -- support file
|
||||
|
||||
import A from "./bug1689499-a.js";
|
||||
if (true) await 0;
|
||||
export default "C";
|
||||
throw Error("FAIL");
|
||||
|
||||
|
3
js/src/tests/non262/module/bug1689499-x.js
Normal file
3
js/src/tests/non262/module/bug1689499-x.js
Normal file
@ -0,0 +1,3 @@
|
||||
// |reftest| skip -- support file
|
||||
import B from "./bug1689499-b.js";
|
||||
export default "X";
|
29
js/src/tests/non262/module/bug1689499.js
Normal file
29
js/src/tests/non262/module/bug1689499.js
Normal file
@ -0,0 +1,29 @@
|
||||
// |reftest| shell-option(--enable-top-level-await) module async
|
||||
|
||||
// Load and instantiate "bug1488117-import-namespace.js". "bug1488117-import-namespace.js"
|
||||
// contains an |import*| request for the current module, which triggers GetModuleNamespace for
|
||||
// this module. GetModuleNamespace calls GetExportedNames on the current module, which in turn
|
||||
// resolves and calls GetExportedNames on all |export*| entries.
|
||||
// And that means HostResolveImportedModule is called for "bug1488117-empty.js" before
|
||||
// InnerModuleInstantiation for "bug1488117.js" has resolved that module file.
|
||||
|
||||
async function test() {
|
||||
try {
|
||||
await import("./bug1689499-a.js");
|
||||
throw new Error("import should have failed");
|
||||
} catch (exc) {
|
||||
assertEq(exc.message, "FAIL");
|
||||
}
|
||||
|
||||
try {
|
||||
await import("./bug1689499-x.js");
|
||||
throw new Error("import should have failed");
|
||||
} catch (exc) {
|
||||
assertEq(exc.message, "FAIL");
|
||||
}
|
||||
|
||||
if (typeof reportCompare === "function")
|
||||
reportCompare(0, 0);
|
||||
}
|
||||
|
||||
test();
|
Loading…
Reference in New Issue
Block a user