diff options
Diffstat (limited to 'ext/webstorage')
-rw-r--r-- | ext/webstorage/01_webstorage.js | 5 | ||||
-rw-r--r-- | ext/webstorage/lib.rs | 4 |
2 files changed, 4 insertions, 5 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); diff --git a/ext/webstorage/lib.rs b/ext/webstorage/lib.rs index e7e53d983..9894c265d 100644 --- a/ext/webstorage/lib.rs +++ b/ext/webstorage/lib.rs @@ -38,8 +38,8 @@ pub fn init(origin_storage_dir: Option<PathBuf>) -> Extension { ), ]) .state(move |state| { - if let Some(origin_storage_dir) = origin_storage_dir.clone() { - state.put(OriginStorageDir(origin_storage_dir)); + if let Some(origin_storage_dir) = &origin_storage_dir { + state.put(OriginStorageDir(origin_storage_dir.clone())); } Ok(()) }) |