mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-07 09:04:30 +00:00
We only supported named properties on Storage, and as a result `localStorage[0]` would be disconnected from the Storage's backing map. Fixes at least 20 subtests in WPT in /webstorage.
18 lines
493 B
HTML
18 lines
493 B
HTML
<script src="include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
localStorage["test"] = "value";
|
|
println(localStorage["test"]);
|
|
println(localStorage.getItem("test"));
|
|
|
|
localStorage.setItem("test", "other");
|
|
println(localStorage["test"]);
|
|
println(localStorage.getItem("test"));
|
|
|
|
// Ensure indexed properties work
|
|
localStorage[0] = "foo";
|
|
println(localStorage[0]);
|
|
println(localStorage.getItem("0"));
|
|
});
|
|
</script>
|