Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ES6 modules] HRIM may return errored module until V8 forgets instantiation errors #7664

Merged
merged 1 commit into from
Oct 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<title>Handling of instantiation errors, 8</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<!-- The below module tree should fail to instantiate, since it references undefined identifier. -->
<script type="module" src="instantiation-error-1.js"></script>
<script>
setup({allow_uncaught_exception: true});

promise_test(t => {
return new Promise(resolve => {
window.addEventListener("error", e => {
assert_equals(e.message, "Uncaught SyntaxError: The requested module does not provide an export named 'default'");
resolve();
}, { once: true });
}).then(() => new Promise(resolve => {
window.addEventListener("error", e => {
assert_equals(e.message, "Uncaught SyntaxError: The requested module does not provide an export named 'default'");
resolve();
}, { once: true });
// Load another module tree w/ previously instantiate-failed tree as its sub-tree.
document.head.appendChild(Object.assign(
document.createElement('script'),
{ type: 'module', innerText: 'import "./instantiation-error-1.js"'}));
}));
}, "Instantiate attempt on a tree w/ previously instantiate-failed tree as a sub-tree shouldn't crash.");
</script>