From 1d85c2520575ae3a10c21b6559c58127e0bd489a Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Thu, 17 Nov 2022 02:12:58 +0900 Subject: fix(ext/webstorage): make web storages re-assignable (#16661) --- cli/tests/unit/webstorage_test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 cli/tests/unit/webstorage_test.ts (limited to 'cli') diff --git a/cli/tests/unit/webstorage_test.ts b/cli/tests/unit/webstorage_test.ts new file mode 100644 index 000000000..df32e9edb --- /dev/null +++ b/cli/tests/unit/webstorage_test.ts @@ -0,0 +1,13 @@ +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. +// deno-lint-ignore-file no-explicit-any + +import { assert } from "./test_util.ts"; + +Deno.test({ permissions: "none" }, function webStoragesReassignable() { + // Can reassign to web storages + globalThis.localStorage = 1 as any; + globalThis.sessionStorage = 1 as any; + // The actual values don't change + assert(globalThis.localStorage instanceof globalThis.Storage); + assert(globalThis.sessionStorage instanceof globalThis.Storage); +}); -- cgit v1.2.3