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
Chengzhong Wu
dddc4a5972
lib: fix DOMException subclass support
...
PR-URL: https://github.com/nodejs/node/pull/59680
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Jordan Harband <ljharb@gmail.com >
2025-08-31 17:20:02 +00:00
Chengzhong Wu and Kenta Moriuchi
e679e38b25
lib: make domexception a native error
...
Co-Authored-By: Kenta Moriuchi <moriken@kimamass.com >
PR-URL: https://github.com/nodejs/node/pull/58691
Fixes: https://github.com/nodejs/node/issues/56497
Refs: https://github.com/v8/v8/commit/e3df60f3f5abe85f819ff2fad6a41d0709e30a61
Refs: https://github.com/nodejs/node/pull/58138
Reviewed-By: Jason Zhang <xzha4350@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev >
Reviewed-By: James M Snell <jasnell@gmail.com >
2025-06-21 10:43:37 +00:00
Chengzhong Wu and jazelly
5457443210
lib,src: support DOMException ser-des
...
Added serialization and deserialization support for `DOMException`.
Co-Authored-By: jazelly <xzha4350@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/58649
Fixes: https://github.com/nodejs/node/issues/49181
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Jason Zhang <xzha4350@gmail.com >
2025-06-11 16:11:18 +00:00
Antoine du Hamel
a596af0819
tools: add lint rule to keep primordials in ASCII order
...
PR-URL: https://github.com/nodejs/node/pull/52592
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io >
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2024-04-21 16:53:08 +00:00
Antoine du Hamel
5f76836277
lib: add trailing commas to more internal files
...
PR-URL: https://github.com/nodejs/node/pull/46811
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2023-02-26 11:34:02 +01:00
flakey5
00e5617533
lib: add cause to DOMException
...
PR-URL: https://github.com/nodejs/node/pull/44703
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
2022-10-04 11:33:49 +00:00
Antoine du Hamel
06d8606960
lib: use null-prototype objects for property descriptors
...
Refs: https://github.com/nodejs/node/pull/42921
PR-URL: https://github.com/nodejs/node/pull/43270
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
2022-06-03 09:23:58 +01:00
Darshan Sen
30388fc796
bootstrap: stop delaying instantiation of maps in per-context scripts
...
The linked issue, https://bugs.chromium.org/p/v8/issues/detail?id=6593 ,
is marked as "Fixed", so I think we can revert this now.
This reverts commit 08a9c4a996 .
Signed-off-by: Darshan Sen <raisinten@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/42934
Refs: https://bugs.chromium.org/p/v8/issues/detail?id=9187
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-05-05 12:56:12 +01:00
XadillaX
9759695545
lib: modify DOMException to pass WPT
...
PR-URL: https://github.com/nodejs/node/pull/41517
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2022-01-20 13:45:54 +08:00
XadillaX
38b7961ce6
url,lib: pass urlsearchparams-constructor.any.js
...
According to WPT:
1. `URLSearchParams` constructor should throw exactly `TypeError` if any
Error occurrs.
2. When a record passed to `URLSearchParams` constructor, two different
key may result same after `toUVString()`. We should leave only the
later one.
PR-URL: https://github.com/nodejs/node/pull/41197
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com >
2022-01-11 18:29:31 +08:00
Michaël Zasso
4bc4f88ca1
lib: use global Error constructors from primordials
...
PR-URL: https://github.com/nodejs/node/pull/35499
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org >
Reviewed-By: Shingo Inoue <leko.noor@gmail.com >
2020-10-07 13:44:19 +00:00
Sebastien Ahkrin
c9b93e2344
lib: replace use of Error with primordials
...
PR-URL: https://github.com/nodejs/node/pull/31163
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2020-01-04 14:50:18 -08:00
Michaël Zasso
0646eda4fc
lib: flatten access to primordials
...
Store all primordials as properties of the primordials object.
Static functions are prefixed by the constructor's name and prototype
methods are prefixed by the constructor's name followed by "Prototype".
For example: primordials.Object.keys becomes primordials.ObjectKeys.
PR-URL: https://github.com/nodejs/node/pull/30610
Refs: https://github.com/nodejs/node/issues/29766
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2019-11-25 10:28:15 +01:00
Joyee Cheung
08a9c4a996
bootstrap: delay the instantiation of maps in per-context scripts
...
Instantiating maps renders the snapshot non-rehashable
(v8 currently fails silently during `CreateBlob()`).
Then the hash seed would always be the same and not
recomputed if custom V8 snapshot is enabled. This patch
delays the instantiation of the maps in domexception.js
and make it lazy.
PR-URL: https://github.com/nodejs/node/pull/27371
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2019-04-26 07:23:42 +02:00
Joyee Cheung
914d6c9ab8
lib: use primordials in domexception.js
...
PR-URL: https://github.com/nodejs/node/pull/27171
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-04-13 17:53:27 +08:00
Michaël Zasso
908292cf1f
lib: enforce the use of Object from primordials
...
PR-URL: https://github.com/nodejs/node/pull/27146
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
2019-04-12 05:38:45 +02:00
Anna Henningsen
b0de48e854
src,lib: make DOMException available in all Contexts
...
This allows using `DOMException` from Node.js code for any
`vm.Context`.
PR-URL: https://github.com/nodejs/node/pull/26497
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-03-15 16:54:19 +01:00