lib,src: implement QuotaExceededError as DOMException-derived interface#62293
lib,src: implement QuotaExceededError as DOMException-derived interface#62293panva wants to merge 5 commits intonodejs:mainfrom
Conversation
|
Review requested:
|
Implement QuotaExceededError as a DOMException-derived interface per the WebIDL specification update. QuotaExceededError is now a proper constructor exposed as a global [Exposed=*] interface that extends DOMException with optional `quota` and `requested` attributes (both nullable doubles, defaulting to null). The constructor validates that quota and requested are finite, non-negative, and that requested is not less than quota when both are provided. QuotaExceededError is [Serializable] and supports structuredClone, preserving the quota and requested values across the serialization boundary. Callers updated: - crypto.getRandomValues() now throws a QuotaExceededError instance - WebStorage (C++) now constructs QuotaExceededError directly Refs: https://redirect.github.com/whatwg/webidl/pull/1465 Fixes: nodejs#58987
6449ff6 to
f056a79
Compare
| if ('requested' in options) { | ||
| requested = +options.requested; | ||
| if (!NumberIsFinite(requested)) { | ||
| // eslint-disable-next-line no-restricted-syntax |
There was a problem hiding this comment.
Why does this disable line required? It's not obvious...
There was a problem hiding this comment.
Same reason as #62293 (comment), the linter asks to
78:18 error Use an error exported by 'internal/errors' instead no-restricted-syntax
225:17 error Use an error exported by 'internal/errors' instead no-restricted-syntax
230:17 error Use an error exported by 'internal/errors' instead no-restricted-syntax
237:17 error Use an error exported by 'internal/errors' instead no-restricted-syntax
242:17 error Use an error exported by 'internal/errors' instead no-restricted-syntax
248:13 error Use an error exported by 'internal/errors' instead no-restricted-syntax
which we can't here because require() isn't available.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #62293 +/- ##
==========================================
- Coverage 89.66% 89.66% -0.01%
==========================================
Files 676 676
Lines 206556 206688 +132
Branches 39552 39582 +30
==========================================
+ Hits 185218 185336 +118
- Misses 13493 13507 +14
Partials 7845 7845
🚀 New features to boost your workflow:
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
cc @nodejs/tsc for
semver-major
|
Commit Queue failed- Loading data for nodejs/node/pull/62293 ✔ Done loading data for nodejs/node/pull/62293 ----------------------------------- PR info ------------------------------------ Title lib,src: implement QuotaExceededError as DOMException-derived interface (#62293) Author Filip Skokan <panva.ip@gmail.com> (@panva) Branch panva:quotaexceedederror -> nodejs:main Labels semver-major, lib / src, author ready, needs-ci, web-standards Commits 5 - lib,src: implement QuotaExceededError as DOMException-derived interface - fixup! lib,src: implement QuotaExceededError as DOMException-derived … - fixup! lib,src: implement QuotaExceededError as DOMException-derived … - fixup! lib,src: implement QuotaExceededError as DOMException-derived … - fixup! lib,src: implement QuotaExceededError as DOMException-derived … Committers 1 - Filip Skokan <panva.ip@gmail.com> PR-URL: https://github.com/nodejs/node/pull/62293 Fixes: https://redirect.github.com/nodejs/node/issues/58987 Refs: https://redirect.github.com/whatwg/webidl/pull/1465 Reviewed-By: Mattias Buelens <mattias@buelens.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/62293 Fixes: https://redirect.github.com/nodejs/node/issues/58987 Refs: https://redirect.github.com/whatwg/webidl/pull/1465 Reviewed-By: Mattias Buelens <mattias@buelens.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> -------------------------------------------------------------------------------- ℹ This PR was created on Tue, 17 Mar 2026 13:07:44 GMT ✔ Approvals: 4 ✔ - Mattias Buelens (@MattiasBuelens): https://github.com/nodejs/node/pull/62293#pullrequestreview-3962888749 ✔ - Chengzhong Wu (@legendecas) (TSC): https://github.com/nodejs/node/pull/62293#pullrequestreview-3963293507 ✔ - Michaël Zasso (@targos) (TSC): https://github.com/nodejs/node/pull/62293#pullrequestreview-3965622611 ✔ - Colin Ihrig (@cjihrig): https://github.com/nodejs/node/pull/62293#pullrequestreview-3968289651 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2026-03-18T06:14:43Z: https://ci.nodejs.org/job/node-test-pull-request/71853/ - Querying data for job/node-test-pull-request/71853/ ✔ Build data downloaded ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/main up to date... From https://github.com/nodejs/node * branch main -> FETCH_HEAD ✔ origin/main is now up-to-date - Downloading patch for 62293 From https://github.com/nodejs/node * branch refs/pull/62293/merge -> FETCH_HEAD ✔ Fetched commits as 4ee467f91254..5a8ef66a61b6 -------------------------------------------------------------------------------- Auto-merging eslint.config.mjs [main 26c37eeb73] lib,src: implement QuotaExceededError as DOMException-derived interface Author: Filip Skokan <panva.ip@gmail.com> Date: Tue Mar 17 13:48:16 2026 +0100 14 files changed, 357 insertions(+), 48 deletions(-) create mode 100644 lib/internal/quota_exceeded_error.js create mode 100644 test/parallel/test-quotaexceedederror.js [main 88cb48523f] fixup! lib,src: implement QuotaExceededError as DOMException-derived interface Author: Filip Skokan <panva.ip@gmail.com> Date: Tue Mar 17 14:29:40 2026 +0100 1 file changed, 13 insertions(+), 16 deletions(-) [main a9e1edc1b5] fixup! lib,src: implement QuotaExceededError as DOMException-derived interface Author: Filip Skokan <panva.ip@gmail.com> Date: Tue Mar 17 14:41:05 2026 +0100 1 file changed, 26 insertions(+), 27 deletions(-) [main 950f39c772] fixup! lib,src: implement QuotaExceededError as DOMException-derived interface Author: Filip Skokan <panva.ip@gmail.com> Date: Tue Mar 17 15:11:20 2026 +0100 1 file changed, 1 insertion(+) [main e97b1b48b1] fixup! lib,src: implement QuotaExceededError as DOMException-derived interface Author: Filip Skokan <panva.ip@gmail.com> Date: Tue Mar 17 20:47:27 2026 +0100 2 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 lib/internal/quota_exceeded_error.js ✔ Patches applied There are 5 commits in the PR. Attempting autorebase. (node:349) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated. (Use `node --trace-deprecation ...` to show where the warning was created) Rebasing (2/6) Rebasing (3/6) Rebasing (4/6) Rebasing (5/6) Rebasing (6/6) Executing: git node land --amend --yes ⚠ Found Refs: https://redirect.github.com/whatwg/webidl/pull/1465, skipping.. --------------------------------- New Message ---------------------------------- lib,src: implement QuotaExceededError as DOMException-derived interface
Refs: https://redirect.github.com/whatwg/webidl/pull/1465
|
Implement QuotaExceededError as a DOMException-derived interface per the WebIDL specification update. QuotaExceededError is now a proper constructor exposed as a global [Exposed=*] interface that extends DOMException with optional `quota` and `requested` attributes (both nullable doubles, defaulting to null). The constructor validates that quota and requested are finite, non-negative, and that requested is not less than quota when both are provided. QuotaExceededError is [Serializable] and supports structuredClone, preserving the quota and requested values across the serialization boundary. Callers updated: - crypto.getRandomValues() now throws a QuotaExceededError instance - WebStorage (C++) now constructs QuotaExceededError directly Refs: https://redirect.github.com/whatwg/webidl/pull/1465 Fixes: #58987 PR-URL: #62293 Reviewed-By: Mattias Buelens <mattias@buelens.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
|
Landed in b328bf7 |
Implement QuotaExceededError as a DOMException-derived interface per the WebIDL specification update.
QuotaExceededError is now a proper constructor exposed as a global [Exposed=*] interface that extends DOMException with optional
quotaandrequestedattributes (both nullable doubles, defaulting to null).The constructor validates that quota and requested are finite, non-negative, and that requested is not less than quota when both are provided.
QuotaExceededError is [Serializable] and supports structuredClone, preserving the quota and requested values across the serialization boundary.
Callers updated:
Refs: https://redirect.github.com/whatwg/webidl/pull/1465
Fixes: https://redirect.github.com/nodejs/node/issues/58987
cc @domenic