deno icon indicating copy to clipboard operation
deno copied to clipboard

feat: upgrade QuotaExceededError to DOMException subclassfeat: upgrade QuotaExceededError to DOMException subclass

Open Bitshifter-9 opened this issue 1 month ago • 2 comments

Implements Web IDL spec change (whatwg/webidl#1465) to upgrade QuotaExceededError from a DOMException name to a proper subclass.

Changes

  • Remove QuotaExceededError from DOMException names table in ext/web/01_dom_exception.js
  • Create QuotaExceededError class extending DOMException with quota and requested properties (default to null)
  • Update error registration in runtime/js/99_main.js to use new QuotaExceededError class
  • Add comprehensive tests for QuotaExceededError subclass in tests/unit/dom_exception_test.ts

Breaking Change

⚠️ new DOMException("message", "QuotaExceededError").code now returns 0 instead of 22 to align with the Web IDL spec.

Fixes #30028

cc @domenicImplements Web IDL spec change (whatwg/webidl#1465) to upgrade QuotaExceededError from a DOMException name to a proper subclass.

Changes:

  • Remove QuotaExceededError from DOMException names table
  • Create QuotaExceededError class extending DOMException
  • Add quota and requested properties (default to null)
  • Update error registration to use new QuotaExceededError class
  • Add comprehensive tests for QuotaExceededError subclass

Fixes #30028

Bitshifter-9 avatar Nov 28 '25 00:11 Bitshifter-9

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Nov 28 '25 00:11 CLAassistant

Walkthrough

Removes the QuotaExceededError name-to-code mapping and adds a new public QuotaExceededError class extending DOMException with private fields #quota and #requested, a constructor (message = "", options = { __proto__: null }), and getters quota and requested. webidl.configureInterface(QuotaExceededError) is called and the export list now includes QuotaExceededError. Runtime code now constructs new QuotaExceededError(msg) where applicable, and unit tests validating class hierarchy, defaults, and option handling were added.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly describes the main change: upgrading QuotaExceededError to a DOMException subclass, which matches the core objective of the PR.
Description check ✅ Passed Description is directly related to the changeset, detailing the Web IDL spec implementation with specific files modified and the breaking change.
Linked Issues check ✅ Passed The PR implements both the minimal change (removing QuotaExceededError from the DOMException names table) and the extended option (implementing a proper QuotaExceededError subclass with quota and requested properties) from issue #30028.
Out of Scope Changes check ✅ Passed All changes in the PR are scoped to implementing the Web IDL spec change for QuotaExceededError. The minor formatting changes to test/bench in 99_main.js appear incidental but don't represent out-of-scope functionality.
✨ Finishing touches
  • [ ] 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Nov 28 '25 00:11 coderabbitai[bot]