Commit Graph
17 Commits
Author SHA1 Message Date
Mohamed Sayed fda667a6c8 src: fix crash when reading length on Storage.prototype
Signed-off-by: Mohamed Sayed <k@3zrv.com>
PR-URL: https://github.com/nodejs/node/pull/63529
Fixes: https://github.com/nodejs/node/issues/63514
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-05-27 08:13:58 +00:00
Igor Sheludko 8aea917381 src: stop using v8::PropertyCallbackInfo<T>::This()
Refs: https://github.com/nodejs/node/issues/60616
PR-URL: https://github.com/nodejs/node/pull/61898
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-04-24 18:01:35 +02:00
Ryuhei Shima d93935bf72 inspector: auto collect webstorage data
PR-URL: https://github.com/nodejs/node/pull/62145
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-04-06 08:17:55 +00:00
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
Tobias Nießen 58f5da2223 src: use C++ nullptr in webstorage
Using the C-style constant `0` to represent a null pointer is less type
safe than the C++-style constant `nullptr`, so we should always be using
`nullptr` instead of `0`.

PR-URL: https://github.com/nodejs/node/pull/61407
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
2026-01-19 13:25:16 +00:00
Chengzhong Wu 430db0d310 src: simply uint32 to string as it must not fail
PR-URL: https://github.com/nodejs/node/pull/60846
Refs: https://github.com/nodejs/node/pull/53959
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2025-11-27 07:22:14 +00:00
Michaël Zasso 5623194a6b doc,src,test: replace use of deprecated GetIsolate
`Isolate::GetCurrent()` should be used instead as it returns the same
thing.

Refs: https://github.com/v8/v8/commit/5c4a937aafff2ca21257387510101737afbf10ab
PR-URL: https://github.com/nodejs/node/pull/59805
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2025-10-04 18:48:35 +02:00
Moonki Choi db926dc1fc src: replace FIXED_ONE_BYTE_STRING with Environment-cached strings
PR-URL: https://github.com/nodejs/node/pull/59891
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2025-09-17 06:34:40 +00:00
James M Snell 98d4ebc6d4 src: use v8::LocalVector consistently with other minor cleanups
V8 introduced `v8::LocalVector` somewhat recently as an alternative
to using `std::vector<v8::Local<T>>` to help ensure that Local handles
are handled correctly. This updates most (but not all) of our uses
of `std::vector<v8::Local<T>>` to use `v8::LocalVector<T>` with a few
other minor cleanups encountered along the way.

PR-URL: https://github.com/nodejs/node/pull/56417
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-01-01 16:27:39 -08:00
Aviv Keller e4ca097f56 src: switch from Get/SetPrototype to Get/SetPrototypeV2
PR-URL: https://github.com/nodejs/node/pull/55453
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-10-22 05:05:19 +00:00
Michaël Zasso 4f1c27af8c src: handle errors correctly in webstorage
PR-URL: https://github.com/nodejs/node/pull/54544
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2024-08-26 17:20:09 +00:00
Michaël Zasso c062b5242a src: use correct way to signal interceptor error
PR-URL: https://github.com/nodejs/node/pull/54418
Refs: https://github.com/nodejs/node/blob/e4f61de14f8cfb83f1ce0ad1597b86278cd5f5f1/deps/v8/include/v8-function-callback.h#L398-L408
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Cheng Zhao <zcbenz@gmail.com>
2024-08-24 17:09:39 +00:00
James M Snell eb85db4606 src: switch from ToLocalChecked to ToLocal in node_webstorage
PR-URL: https://github.com/nodejs/node/pull/53959
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2024-07-21 22:11:33 +00:00
Yagiz Nizipli 1fb23f1897 src: move ToNamespacedPath call of webstorage
PR-URL: https://github.com/nodejs/node/pull/53875
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-07-21 20:49:10 +00:00
Yagiz Nizipli 05b7bf01a5 src: refactor webstorage implementation
PR-URL: https://github.com/nodejs/node/pull/53876
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-07-18 20:41:49 +00:00
Michaël Zasso c93e256ee7 src: use args.This() instead of Holder
The latter is deprecated in V8.

Refs: http://crbug.com/333672197
PR-URL: https://github.com/nodejs/node/pull/53474
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2024-06-18 16:02:42 +00:00
cjihrig 3d09e579d3 deps,lib,src: add experimental web storage
This commit introduces an experimental implementation of the Web
Storage API using SQLite as the backing data store.

PR-URL: https://github.com/nodejs/node/pull/52435
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2024-06-14 18:40:04 +00:00