blob: 88fb23a00d963b97e789deb5750e8a6ad62b533a (
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" with { type: "json" };
</script>
|