New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@whatwg-node/disposablestack

Package Overview
Dependencies
Maintainers
0
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@whatwg-node/disposablestack - npm Package Compare versions

Comparing version 0.0.2-rc-20240821205836-a75eca740055dd912dde456b68e86737ad95c8c9 to 0.0.2-rc-20240821210630-5a1df466e882f2ed5bab2e516761e8344c9aadde

23

cjs/AsyncDisposableStack.js

@@ -21,7 +21,11 @@ "use strict";

adopt(value, onDisposeAsync) {
this.callbacks.push(() => onDisposeAsync(value));
if (onDisposeAsync) {
this.callbacks.push(() => onDisposeAsync(value));
}
return value;
}
defer(onDisposeAsync) {
this.callbacks.push(onDisposeAsync);
if (onDisposeAsync) {
this.callbacks.push(onDisposeAsync);
}
}

@@ -39,5 +43,5 @@ move() {

_iterateCallbacks() {
try {
const cb = this.callbacks.pop();
if (cb) {
const cb = this.callbacks.pop();
if (cb) {
try {
const res$ = cb();

@@ -51,8 +55,5 @@ if (res$?.then) {

}
}
catch (error) {
this._error = this._error ? new SuppressedError(error, this._error) : error;
}
finally {
// eslint-disable-next-line no-unsafe-finally
catch (error) {
this._error = this._error ? new SuppressedError(error, this._error) : error;
}
return this._iterateCallbacks();

@@ -59,0 +60,0 @@ }

@@ -18,7 +18,11 @@ "use strict";

adopt(value, onDispose) {
this.callbacks.push(() => onDispose(value));
if (onDispose) {
this.callbacks.push(() => onDispose(value));
}
return value;
}
defer(onDispose) {
this.callbacks.push(onDispose);
if (onDispose) {
this.callbacks.push(onDispose);
}
}

@@ -34,6 +38,12 @@ move() {

}
_error;
_iterateCallbacks() {
const cb = this.callbacks.pop();
if (cb) {
cb();
try {
cb();
}
catch (error) {
this._error = this._error ? new SuppressedError(error, this._error) : error;
}
return this._iterateCallbacks();

@@ -40,0 +50,0 @@ }

@@ -18,7 +18,11 @@ import { DisposableSymbols } from './symbols.js';

adopt(value, onDisposeAsync) {
this.callbacks.push(() => onDisposeAsync(value));
if (onDisposeAsync) {
this.callbacks.push(() => onDisposeAsync(value));
}
return value;
}
defer(onDisposeAsync) {
this.callbacks.push(onDisposeAsync);
if (onDisposeAsync) {
this.callbacks.push(onDisposeAsync);
}
}

@@ -36,5 +40,5 @@ move() {

_iterateCallbacks() {
try {
const cb = this.callbacks.pop();
if (cb) {
const cb = this.callbacks.pop();
if (cb) {
try {
const res$ = cb();

@@ -48,8 +52,5 @@ if (res$?.then) {

}
}
catch (error) {
this._error = this._error ? new SuppressedError(error, this._error) : error;
}
finally {
// eslint-disable-next-line no-unsafe-finally
catch (error) {
this._error = this._error ? new SuppressedError(error, this._error) : error;
}
return this._iterateCallbacks();

@@ -56,0 +57,0 @@ }

@@ -15,7 +15,11 @@ import { DisposableSymbols } from './symbols.js';

adopt(value, onDispose) {
this.callbacks.push(() => onDispose(value));
if (onDispose) {
this.callbacks.push(() => onDispose(value));
}
return value;
}
defer(onDispose) {
this.callbacks.push(onDispose);
if (onDispose) {
this.callbacks.push(onDispose);
}
}

@@ -31,6 +35,12 @@ move() {

}
_error;
_iterateCallbacks() {
const cb = this.callbacks.pop();
if (cb) {
cb();
try {
cb();
}
catch (error) {
this._error = this._error ? new SuppressedError(error, this._error) : error;
}
return this._iterateCallbacks();

@@ -37,0 +47,0 @@ }

{
"name": "@whatwg-node/disposablestack",
"version": "0.0.2-rc-20240821205836-a75eca740055dd912dde456b68e86737ad95c8c9",
"version": "0.0.2-rc-20240821210630-5a1df466e882f2ed5bab2e516761e8344c9aadde",
"description": "Cross Platform Smart DisposableStack API Ponyfill",

@@ -5,0 +5,0 @@ "sideEffects": false,

@@ -10,2 +10,3 @@ import { DisposableSymbols } from './symbols.js';

dispose(): void;
private _error?;
private _iterateCallbacks;

@@ -12,0 +13,0 @@ [DisposableSymbols.dispose](): void;

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc