MCPcopy Index your code
hub / github.com/nodejs/node / leakedGlobals

Function leakedGlobals

test/common/index.js:411–431  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

409 }
410
411 function leakedGlobals() {
412 const leaked = [];
413
414 for (const val in globalThis) {
415 // globalThis.crypto is a getter that throws if Node.js was compiled
416 // without OpenSSL so we'll skip it if it is not available.
417 if (val === 'crypto' && !hasCrypto) {
418 continue;
419 }
420 // globalThis.localStorage is a getter that throws if Node.js was
421 // executed without a --localstorage-file path.
422 if (val === 'localStorage' && !hasLocalStorage) {
423 continue;
424 }
425 if (!knownGlobals.has(globalThis[val])) {
426 leaked.push(val);
427 }
428 }
429
430 return leaked;
431 }
432
433 process.on('exit', function() {
434 const leaked = leakedGlobals();

Callers 1

index.jsFile · 0.85

Calls 2

hasMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…