node/lib/internal/bootstrap
Filip Skokan b328bf74bd
lib,src: implement QuotaExceededError as DOMException-derived interface
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: https://github.com/nodejs/node/issues/58987
PR-URL: https://github.com/nodejs/node/pull/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>
2026-03-19 14:41:50 +01:00
..
switches lib: reduce cycles in esm loader and load it in snapshot 2026-02-19 12:52:24 +00:00
web lib,src: implement QuotaExceededError as DOMException-derived interface 2026-03-19 14:41:50 +01:00
node.js repl: remove dependency on domain module 2026-03-06 15:38:36 +00:00
realm.js lib,src: cache ModuleWrap.hasAsyncGraph 2025-09-11 12:54:24 +00:00
shadow_realm.js module: bootstrap module loaders in shadow realm 2023-11-13 22:09:47 +08:00