Skip to content

Commit 383a3ce

Browse files
committed
Enable reportError tests in ShadowRealm
reportError seems to be minimally tested. ShadowRealm doesn't have the location exposed, so just assume it will be blank. This may need to be changed depending on what browsers do. It is not specified what the value should be in https://html.spec.whatwg.org/#extract-error: "Set _attributes_[message], _attributes_[filename], _attributes_[lineno], and _attributes_[colno] to implementation-defined values derived from _exception_. NOTE: Browsers implement behavior not specified here or in the JavaScript specification to gather values which are helpful, including in unusual cases (e.g., `eval`). In the future, this might be specified in greater detail. This seems like exactly such an unusual case.
1 parent 2966207 commit 383a3ce

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

html/webappapis/scripting/reporterror.any.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// META: global=window,dedicatedworker,shadowrealm
2+
13
setup({ allow_uncaught_exception:true });
24

35
[
@@ -9,7 +11,7 @@ setup({ allow_uncaught_exception:true });
911
let happened = false;
1012
self.addEventListener("error", t.step_func(e => {
1113
assert_true(e.message !== "");
12-
assert_equals(e.filename, new URL("reporterror.any.js", location.href).href);
14+
assert_equals(e.filename, location ? new URL("reporterror.any.js", location.href).href : "");
1315
assert_greater_than(e.lineno, 0);
1416
assert_greater_than(e.colno, 0);
1517
assert_equals(e.error, throwable);

0 commit comments

Comments
 (0)