jest-leak-detector
Advanced tools
Comparing version 24.0.0-alpha.8 to 24.0.0-alpha.9
@@ -9,3 +9,2 @@ /** | ||
*/ | ||
'use strict'; | ||
@@ -16,19 +15,32 @@ | ||
}); | ||
exports.default = void 0; | ||
var _prettyFormat; | ||
function _prettyFormat() { | ||
const data = _interopRequireDefault(require('pretty-format')); | ||
function _load_prettyFormat() { | ||
return (_prettyFormat = _interopRequireDefault(require('pretty-format'))); | ||
_prettyFormat = function _prettyFormat() { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
var _v; | ||
function _v() { | ||
const data = _interopRequireDefault(require('v8')); | ||
function _load_v() { | ||
return (_v = _interopRequireDefault(require('v8'))); | ||
_v = function _v() { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
var _vm; | ||
function _vm() { | ||
const data = _interopRequireDefault(require('vm')); | ||
function _load_vm() { | ||
return (_vm = _interopRequireDefault(require('vm'))); | ||
_vm = function _vm() { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
@@ -40,3 +52,3 @@ | ||
exports.default = class { | ||
class _default { | ||
constructor(value) { | ||
@@ -50,3 +62,3 @@ if (this._isPrimitive(value)) { | ||
': <' + | ||
(0, (_prettyFormat || _load_prettyFormat()).default)(value) + | ||
(0, _prettyFormat().default)(value) + | ||
'>' | ||
@@ -74,5 +86,4 @@ ].join(' ') | ||
weak(value, () => (this._isReferenceBeingHeld = false)); | ||
this._isReferenceBeingHeld = true; | ||
this._isReferenceBeingHeld = true; // Ensure value is not leaked by the closure created by the "weak" callback. | ||
// Ensure value is not leaked by the closure created by the "weak" callback. | ||
value = null; | ||
@@ -88,11 +99,10 @@ } | ||
_runGarbageCollector() { | ||
const isGarbageCollectorHidden = !global.gc; | ||
const isGarbageCollectorHidden = !global.gc; // GC is usually hidden, so we have to expose it before running. | ||
// GC is usually hidden, so we have to expose it before running. | ||
(_v || _load_v()).default.setFlagsFromString('--expose-gc'); | ||
(_vm || _load_vm()).default.runInNewContext('gc')(); | ||
_v().default.setFlagsFromString('--expose-gc'); | ||
// The GC was not initially exposed, so let's hide it again. | ||
_vm().default.runInNewContext('gc')(); // The GC was not initially exposed, so let's hide it again. | ||
if (isGarbageCollectorHidden) { | ||
(_v || _load_v()).default.setFlagsFromString('--no-expose-gc'); | ||
_v().default.setFlagsFromString('--no-expose-gc'); | ||
} | ||
@@ -104,2 +114,4 @@ } | ||
} | ||
}; | ||
} | ||
exports.default = _default; |
{ | ||
"name": "jest-leak-detector", | ||
"version": "24.0.0-alpha.8", | ||
"version": "24.0.0-alpha.9", | ||
"repository": { | ||
@@ -11,3 +11,3 @@ "type": "git", | ||
"dependencies": { | ||
"pretty-format": "^24.0.0-alpha.8" | ||
"pretty-format": "^24.0.0-alpha.9" | ||
}, | ||
@@ -20,3 +20,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "700e0dadb85f5dc8ff5dac6c7e98956690049734" | ||
"gitHead": "c7caa7ba5904d0c61e586694cde5f536639e4afc" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
85
0
4507
4