Revision b305e43f8a9d2a94931d673d90606c1d01d1231f authored by pyup.io bot on 24 July 2018, 13:52:42 UTC, committed by jgraham on 24 July 2018, 13:52:42 UTC
1 parent 4273df6
storage_indexing.html
<!DOCTYPE HTML>
<meta charset=utf-8>
<title>WebStorage Test: Storage - indexed getter</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
["localStorage", "sessionStorage"].forEach(function(name) {
test(function() {
var storage = window[name];
storage.clear();
storage["name"] = "user1";
storage["age"] = "42";
test(function() {
assert_equals(storage[-1], undefined);
assert_equals(storage[0], undefined);
assert_equals(storage[1], undefined);
assert_equals(storage[2], undefined);
}, "Getting number properties on " + name);
test(function() {
assert_equals(storage["-1"], undefined);
assert_equals(storage["0"], undefined);
assert_equals(storage["1"], undefined);
assert_equals(storage["2"], undefined);
}, "Getting number-valued string properties on " + name);
test(function() {
storage.setItem(1, "number");
assert_equals(storage[1], "number");
assert_equals(storage["1"], "number");
}, "Getting existing number-valued properties on " + name);
}, "Indexed getter on " + name);
});
</script>
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...