We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 390d068 commit 3cda35aCopy full SHA for 3cda35a
test/common/index.js
@@ -318,11 +318,15 @@ const knownGlobals = new Set([
318
'sessionStorage',
319
].forEach((i) => {
320
if (i === 'localStorage') {
321
- Object.defineProperty(globalThis, i, {
322
- configurable: true,
323
- enumerable: true,
324
- get() {
325
- return undefined;
+ const getLocalStorage = Object.defineProperty(() => {}, 'name', {
+ value: 'get localStorage',
+ });
+
+ Object.defineProperties(globalThis, {
326
+ localStorage: {
327
+ configurable: true,
328
+ enumerable: true,
329
+ get: getLocalStorage,
330
},
331
});
332
0 commit comments