From 75e5b95bf8307cbc4b9fa5b7af95f033f389df05 Mon Sep 17 00:00:00 2001 From: Kyle Tse Date: Thu, 12 Feb 2026 23:43:50 +0000 Subject: [PATCH] fix(ext/web): remove QuotaExceededError from DOMException error names table Per https://github.com/whatwg/webidl/pull/1465, QuotaExceededError has been updated from a legacy DOMException name to a proper DOMException subclass. As the minimal change, this removes QuotaExceededError from the error names table so that `new DOMException('msg', 'QuotaExceededError').code` returns 0 instead of 22, aligning with the updated spec. Fixes #30028 --- ext/web/01_dom_exception.js | 1 - tests/unit/dom_exception_test.ts | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ext/web/01_dom_exception.js b/ext/web/01_dom_exception.js index d654d07317f7ea..796ba38f808a34 100644 --- a/ext/web/01_dom_exception.js +++ b/ext/web/01_dom_exception.js @@ -82,7 +82,6 @@ const nameToCodeMapping = ObjectCreate(null, { NetworkError: { value: NETWORK_ERR }, AbortError: { value: ABORT_ERR }, URLMismatchError: { value: URL_MISMATCH_ERR }, - QuotaExceededError: { value: QUOTA_EXCEEDED_ERR }, TimeoutError: { value: TIMEOUT_ERR }, InvalidNodeTypeError: { value: INVALID_NODE_TYPE_ERR }, DataCloneError: { value: DATA_CLONE_ERR }, diff --git a/tests/unit/dom_exception_test.ts b/tests/unit/dom_exception_test.ts index 82138d78428cab..8aad75fcbd5cff 100644 --- a/tests/unit/dom_exception_test.ts +++ b/tests/unit/dom_exception_test.ts @@ -30,3 +30,11 @@ Deno.test(function hasStackAccessor() { assert(typeof desc.get === "function"); assert(typeof desc.set === "function"); }); + +Deno.test(function quotaExceededErrorCodeIsZero() { + // Per https://github.com/whatwg/webidl/pull/1465, QuotaExceededError is no + // longer in the DOMException error names table, so its code should be 0. + const e = new DOMException("test", "QuotaExceededError"); + assertEquals(e.code, 0); + assertEquals(e.name, "QuotaExceededError"); +});