Skip to content

Commit

Permalink
Remove ErrorEventInit's error's null default value
Browse files Browse the repository at this point in the history
Per the spec change [1], this removes ErrorEventInit's default value
of null, which makes the error attribute have no null default.

This change has already shipped on WebKit and Gecko, and the change
makes Chromium match the spec and other implementations. This is tested
by this WPT:

wpt/html/webappapis/scripting/events/event-handler-processing-algorithm-error/document-synthetic-errorevent.html

[1] whatwg/html#7983

Fixed: 1332448
Change-Id: Ia64a62e8c5739ab278016a94b0c3b0419d6a68f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3749784
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Auto-Submit: Mason Freed <masonf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1021841}
  • Loading branch information
mfreed7 authored and chromium-wpt-export-bot committed Jul 7, 2022
1 parent 8016ebe commit 15f82e2
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,20 @@
assert_equals(e.colno, 0);
assert_equals(e.error, undefined);
}, "Initial values of ErrorEvent members")

test(() => {
const e = new ErrorEvent("error", {error : null});
assert_equals(e.error, null);
}, "error member can be set to null")

test(() => {
const e = new ErrorEvent("error", {error : undefined});
assert_equals(e.error, undefined);
}, "error member can be set to undefined")

test(() => {
const e = new ErrorEvent("error", {error : "foo"});
assert_equals(e.error, "foo");
}, "error member can be set to arbitrary")

</script>

0 comments on commit 15f82e2

Please sign in to comment.