mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
3d09e579d3
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>
24 lines
702 B
JavaScript
24 lines
702 B
JavaScript
["localStorage", "sessionStorage"].forEach(function(name) {
|
|
test(function() {
|
|
var storage = window[name];
|
|
storage.clear();
|
|
assert_equals(storage.length, 0, "storage.length")
|
|
|
|
storage["name"] = "user1";
|
|
storage["age"] = "20";
|
|
|
|
assert_equals(storage.length, 2, "storage.length")
|
|
}, name + ".length (method access)");
|
|
|
|
test(function() {
|
|
var storage = window[name];
|
|
storage.clear();
|
|
assert_equals(storage.length, 0, "storage.length")
|
|
|
|
storage.setItem("name", "user1");
|
|
storage.setItem("age", "20");
|
|
|
|
assert_equals(storage.length, 2, "storage.length")
|
|
}, name + ".length (proprty access)");
|
|
});
|