summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/json-module-assertions/parse-error.html
blob: 9d0e3284fec6e69476162c67f2aec81d2f5a3577 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!DOCTYPE html>
<meta charset=utf-8>
<title>JSON modules: parse error</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
setup({
  allow_uncaught_exception: true,
});
async_test(t => {
  window.addEventListener("error", t.step_func_done(e => {
    assert_true(e instanceof ErrorEvent, "ErrorEvent");
    assert_equals(e.filename, new URL("parse-error.json", location).href);
    assert_true(e.error instanceof SyntaxError, "SyntaxError");
  }));
});
</script>
<script type="module">
import v from "./parse-error.json" assert { type: "json" };
</script>