Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

continuation-local-storage

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

continuation-local-storage - npm Package Compare versions

Comparing version 3.1.5 to 3.1.6

__testfile

8

context.js

@@ -52,3 +52,5 @@ 'use strict';

catch (exception) {
exception[ERROR_SYMBOL] = context;
if (exception) {
exception[ERROR_SYMBOL] = context;
}
throw exception;

@@ -78,3 +80,5 @@ }

catch (exception) {
exception[ERROR_SYMBOL] = context;
if (exception) {
exception[ERROR_SYMBOL] = context;
}
throw exception;

@@ -81,0 +85,0 @@ }

{
"name": "continuation-local-storage",
"version": "3.1.5",
"version": "3.1.6",
"description": "userland implementation of https://github.com/joyent/node/issues/5243",

@@ -5,0 +5,0 @@ "main": "context.js",

@@ -62,2 +62,25 @@ 'use strict';

test("synchronous throw checks if error exists", function (t) {
t.plan(2);
var namespace = cls.createNamespace('cls@synchronous-null-error');
namespace.run(function () {
namespace.set('value', 'transaction clear');
try {
namespace.run(function () {
namespace.set('value', 'transaction set');
throw null;
});
}
catch (e) {
// as we had a null error, cls couldn't set the new inner value
t.equal(namespace.get('value'), 'transaction clear', 'from outer value');
}
t.equal(namespace.get('value'), 'transaction clear', "everything was reset");
});
cls.destroyNamespace('cls@synchronous-null-error');
});
test("throw in process.nextTick attaches the context", function (t) {

@@ -64,0 +87,0 @@ t.plan(3);

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