continuation-local-storage
Advanced tools
Comparing version 3.1.5 to 3.1.6
@@ -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); |
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
97936
26
2213