@@ -59,14 +59,6 @@ const hasSQLite = Boolean(process.versions.sqlite);
|
59 | 59 | |
60 | 60 | const hasQuic = hasCrypto && !!process.features.quic; |
61 | 61 | |
62 | | -const hasLocalStorage = (() => { |
63 | | -try { |
64 | | -return hasSQLite && globalThis.localStorage !== undefined; |
65 | | -} catch { |
66 | | -return false; |
67 | | -} |
68 | | -})(); |
69 | | - |
70 | 62 | /** |
71 | 63 | * Parse test metadata from the specified file. |
72 | 64 | * @param {string} filename - The name of the file to parse. |
@@ -359,6 +351,7 @@ const knownGlobals = new Set([
|
359 | 351 | 'CompressionStream', |
360 | 352 | 'DecompressionStream', |
361 | 353 | 'Storage', |
| 354 | +'localStorage', |
362 | 355 | 'sessionStorage', |
363 | 356 | ].forEach((i) => { |
364 | 357 | if (globalThis[i] !== undefined) { |
@@ -373,10 +366,6 @@ if (hasCrypto) {
|
373 | 366 | knownGlobals.add(globalThis.SubtleCrypto); |
374 | 367 | } |
375 | 368 | |
376 | | -if (hasLocalStorage) { |
377 | | -knownGlobals.add(globalThis.localStorage); |
378 | | -} |
379 | | - |
380 | 369 | const { Worker } = require('node:worker_threads'); |
381 | 370 | knownGlobals.add(Worker); |
382 | 371 | |
@@ -401,11 +390,6 @@ if (process.env.NODE_TEST_KNOWN_GLOBALS !== '0') {
|
401 | 390 | if (val === 'crypto' && !hasCrypto) { |
402 | 391 | continue; |
403 | 392 | } |
404 | | -// globalThis.localStorage is a getter that throws if Node.js was |
405 | | -// executed without a --localstorage-file path. |
406 | | -if (val === 'localStorage' && !hasLocalStorage) { |
407 | | -continue; |
408 | | -} |
409 | 393 | if (!knownGlobals.has(globalThis[val])) { |
410 | 394 | leaked.push(val); |
411 | 395 | } |
@@ -956,7 +940,6 @@ const common = {
|
956 | 940 | hasQuic, |
957 | 941 | hasInspector, |
958 | 942 | hasSQLite, |
959 | | - hasLocalStorage, |
960 | 943 | invalidArgTypeHelper, |
961 | 944 | isAlive, |
962 | 945 | isASan, |
|