summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/inactive-context-import.html
blob: ce88c0a1528613e6586f2188e583d44d5c89fe67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!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>