Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/scripting-1/the-script-element/module/inactive-context-import.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>Dynamic import triggered from inactive context should not crash</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="container">
<iframe></iframe>
</div>
<script>
test(() => {
const iframe = document.querySelector('iframe');
const otherWindow = iframe.contentWindow;
iframe.remove();
// Below should not crash
otherWindow.eval(`import('foobar');`);
}, 'dynamic import from inactive context should not crash');
</script>