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/json-module/parse-error-location.tentative.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset=utf-8>
<title>JSON modules: parse error file location</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 => {
// The specific values of these properties are implementation-defined
// but it's preferable if implementations provide the
// correct file location.
assert_equals(e.filename, new URL("parse-error.json", location).href);
}));
});
</script>
<script type="module">
import v from "./parse-error.json" with { type: "json" };
</script>