From d10cd17ff6187fba5fbb5f8ae29f06f8ebe32798 Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Mon, 11 Jul 2022 23:03:25 +0000 Subject: [PATCH] Bug 1778686 [wpt PR 34741] - Remove ErrorEventInit's error's null default value, a=testonly Automatic update from web-platform-tests Remove ErrorEventInit's error's null default value 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] https://github.com/whatwg/html/pull/7983 Fixed: 1332448 Change-Id: Ia64a62e8c5739ab278016a94b0c3b0419d6a68f6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3749784 Reviewed-by: Joey Arhar Commit-Queue: Joey Arhar Auto-Submit: Mason Freed Cr-Commit-Position: refs/heads/main@{#1021841} -- wpt-commits: 824d27822a6c110981a6bbb99dddbcdf8455f56a wpt-pr: 34741 --- .../document-synthetic-errorevent.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/testing/web-platform/tests/html/webappapis/scripting/events/event-handler-processing-algorithm-error/document-synthetic-errorevent.html b/testing/web-platform/tests/html/webappapis/scripting/events/event-handler-processing-algorithm-error/document-synthetic-errorevent.html index a541611909767..4165beaf63d5b 100644 --- a/testing/web-platform/tests/html/webappapis/scripting/events/event-handler-processing-algorithm-error/document-synthetic-errorevent.html +++ b/testing/web-platform/tests/html/webappapis/scripting/events/event-handler-processing-algorithm-error/document-synthetic-errorevent.html @@ -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") +