Source code
Revision control
Copy as Markdown
Other Tools
<!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_true(e.error instanceof SyntaxError, "SyntaxError");
// The specific values of these properties are implementation-defined
// But, we can at least check that they exist.
assert_not_equals(e.message, undefined);
assert_not_equals(e.filename, undefined);
assert_not_equals(e.lineno, undefined);
assert_not_equals(e.colno, undefined);
}));
});
</script>
<script type="module">
import v from "./parse-error.json" with { type: "json" };
</script>