From b44e2ba6f3b32b037172a396fea4bf3a06c23a47 Mon Sep 17 00:00:00 2001 From: lionel-rowe Date: Wed, 13 Nov 2024 11:08:05 +0800 Subject: [PATCH 1/3] DOMException: Add test for Error.isError --- .../es-exceptions/DOMException-is-error.any.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 webidl/ecmascript-binding/es-exceptions/DOMException-is-error.any.js diff --git a/webidl/ecmascript-binding/es-exceptions/DOMException-is-error.any.js b/webidl/ecmascript-binding/es-exceptions/DOMException-is-error.any.js new file mode 100644 index 00000000000000..b4ef7ba4b3e691 --- /dev/null +++ b/webidl/ecmascript-binding/es-exceptions/DOMException-is-error.any.js @@ -0,0 +1,9 @@ +'use strict'; + +test(function() { + // https://github.com/tc39/proposal-is-error/issues/9 + // https://github.com/whatwg/webidl/pull/1421 + if (typeof Error.isError === 'function') { + assert_true(Error.isError(new DOMException())); + } +}); From 7f30a91b394cd9ec15286a06cfdab6ffe0764891 Mon Sep 17 00:00:00 2001 From: lionel-rowe Date: Wed, 13 Nov 2024 16:09:16 +0800 Subject: [PATCH 2/3] Remove condition --- .../es-exceptions/DOMException-is-error.any.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/webidl/ecmascript-binding/es-exceptions/DOMException-is-error.any.js b/webidl/ecmascript-binding/es-exceptions/DOMException-is-error.any.js index b4ef7ba4b3e691..eabf90db6446bb 100644 --- a/webidl/ecmascript-binding/es-exceptions/DOMException-is-error.any.js +++ b/webidl/ecmascript-binding/es-exceptions/DOMException-is-error.any.js @@ -3,7 +3,5 @@ test(function() { // https://github.com/tc39/proposal-is-error/issues/9 // https://github.com/whatwg/webidl/pull/1421 - if (typeof Error.isError === 'function') { - assert_true(Error.isError(new DOMException())); - } + assert_true(Error.isError(new DOMException())); }); From 5428a309d3ff2715c43bc0fdbf706be9c57d9b66 Mon Sep 17 00:00:00 2001 From: lionel-rowe Date: Fri, 15 Nov 2024 17:48:39 +0800 Subject: [PATCH 3/3] Update webidl/ecmascript-binding/es-exceptions/DOMException-is-error.any.js Co-authored-by: Philip Chimento --- .../es-exceptions/DOMException-is-error.any.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/webidl/ecmascript-binding/es-exceptions/DOMException-is-error.any.js b/webidl/ecmascript-binding/es-exceptions/DOMException-is-error.any.js index eabf90db6446bb..6f3097b222ed1f 100644 --- a/webidl/ecmascript-binding/es-exceptions/DOMException-is-error.any.js +++ b/webidl/ecmascript-binding/es-exceptions/DOMException-is-error.any.js @@ -1,3 +1,5 @@ +// META: global=window,dedicatedworker,shadowrealm + 'use strict'; test(function() {