diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2021-10-27 11:10:27 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-27 11:10:27 +1100 |
commit | 1c739470b590ea13dc0aa67c0ecc7ea6f49b5746 (patch) | |
tree | a7e6cb862cde74cc7861bc7124c540e62fa951b0 /ext/webstorage/01_webstorage.js | |
parent | 6268703487da02d66552d1e1a42858aa273def90 (diff) |
feat(ext/webstorage): use implied origin when --location not set (#12548)
Closes #11882
BREAKING CHANGE: Previously when `--location` was set, the unique storage key was derived from the the URL of the location instead of just the origin. This change correctly uses just the origin. This may cause previously persisted storage to change its key and data to not be available with the same location as before.
Diffstat (limited to 'ext/webstorage/01_webstorage.js')
-rw-r--r-- | ext/webstorage/01_webstorage.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/webstorage/01_webstorage.js b/ext/webstorage/01_webstorage.js index 558522a3c..4abb64bfc 100644 --- a/ext/webstorage/01_webstorage.js +++ b/ext/webstorage/01_webstorage.js @@ -91,8 +91,6 @@ } function createStorage(persistent) { - if (persistent) window.location; - const storage = webidl.createBranded(Storage); storage[_persistent] = persistent; @@ -133,7 +131,8 @@ return true; }, has(target, p) { - return (typeof target.getItem(p)) === "string"; + return p === SymbolFor("Deno.customInspect") || + (typeof target.getItem(p)) === "string"; }, ownKeys() { return core.opSync("op_webstorage_iterate_keys", persistent); |