diff options
Diffstat (limited to 'testing/web-platform/tests/html/semantics/scripting-1/the-script-element/json-module/parse-error.html')
-rw-r--r-- | testing/web-platform/tests/html/semantics/scripting-1/the-script-element/json-module/parse-error.html | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/json-module/parse-error.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/json-module/parse-error.html new file mode 100644 index 0000000000..88fb23a00d --- /dev/null +++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/json-module/parse-error.html @@ -0,0 +1,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> |