Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

dc-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dc-polyfill - npm Package Compare versions

Comparing version
0.1.9
to
0.1.10
+35
.vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Test (Node 18)",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/test/diagnostics-channel-store-has-subscribers.spec.js",
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
"runtimeExecutable": "/Users/ugaitz.urien/.nvm/versions/node/v18.20.8/bin/node",
"runtimeArgs": ["--expose-gc"]
},
{
"name": "Debug Test (Node 12)",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/test/diagnostics-channel-store-has-subscribers.spec.js",
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
"runtimeExecutable": "/Users/ugaitz.urien/.nvm/versions/node/v12.22.12/bin/node",
"runtimeArgs": ["--expose-gc"]
},
{
"name": "Debug All Tests (Node 12)",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/test.sh",
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
"runtimeExecutable": "/Users/ugaitz.urien/.nvm/versions/node/v12.22.12/bin/node",
"runtimeArgs": ["--expose-gc"]
}
]
}
+1
-1
{
"name": "dc-polyfill",
"version": "0.1.9",
"version": "0.1.10",
"description": "A polyfill for the internal diagnostics_channel module",

@@ -5,0 +5,0 @@ "main": "dc-polyfill.js",

@@ -1,2 +0,6 @@

const { ReflectApply } = require('./primordials.js');
const {
ReflectApply,
ObjectDefineProperty,
ObjectGetOwnPropertyDescriptor
} = require('./primordials.js');

@@ -51,2 +55,10 @@ module.exports = function (unpatched) {

if (!ObjectGetOwnPropertyDescriptor(ch, 'hasSubscribers')) {
ObjectDefineProperty(ch, 'hasSubscribers', {
get: function() {
return this.__proto__.hasSubscribers || ch._stores.size > 0;
}
});
}
channels.add(ch);

@@ -53,0 +65,0 @@

@@ -30,3 +30,5 @@ // There's a bug where a newly created channel is immediately garbage collected

if (subscribers.length > 1) return true;
if (subscribers.length < 1) return false;
const stores = ch._stores;
if (stores.size > 0) return true;
if (subscribers.length < 1 ) return false;
if (subscribers[0] === PHONY_SUBSCRIBE) return false;

@@ -33,0 +35,0 @@ return true;