Comparing version 1.0.0 to 1.1.0
// Generated by CoffeeScript 1.8.0 | ||
var Fiber, | ||
var Fiber, FiberCLS, | ||
__slice = [].slice; | ||
@@ -7,16 +7,35 @@ | ||
FiberCLS = require('./fiber_cls'); | ||
module.exports = function(ns) { | ||
var runBefore; | ||
var runBefore, yieldBefore; | ||
runBefore = Fiber.prototype.run; | ||
return Fiber.prototype.run = function() { | ||
var args, context; | ||
Fiber.prototype.run = function() { | ||
var args, cls; | ||
args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; | ||
context = this.__cls != null ? this.__cls : this.__cls = ns.createContext(); | ||
ns.enter(context); | ||
cls = this.__cls != null ? this.__cls : this.__cls = new FiberCLS(ns); | ||
if (cls.yielding) { | ||
cls.resume(); | ||
} else { | ||
cls.run(); | ||
} | ||
try { | ||
return runBefore.call.apply(runBefore, [this].concat(__slice.call(args))); | ||
} finally { | ||
ns.exit(context); | ||
if (!cls.yielding) { | ||
cls.end(); | ||
delete this.__cls; | ||
} | ||
} | ||
}; | ||
yieldBefore = Fiber["yield"]; | ||
return Fiber["yield"] = function() { | ||
var args, cls, _ref; | ||
args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; | ||
cls = (_ref = Fiber.current) != null ? _ref.__cls : void 0; | ||
if (cls) { | ||
cls["yield"](); | ||
} | ||
return yieldBefore.apply(null, args); | ||
}; | ||
}; |
{ | ||
"name": "cls-fibers", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Make continuation-local-storage play nice with node-fibers.", | ||
@@ -22,4 +22,3 @@ "author": "Good Eggs <open-source@goodeggs.com>", | ||
"peerDependencies": { | ||
"fibers": "*", | ||
"continuation-local-storage": "*" | ||
"fibers": "*" | ||
}, | ||
@@ -31,3 +30,5 @@ "devDependencies": { | ||
"fibers": "1.x.x", | ||
"mocha": "1.x.x" | ||
"mocha": "1.x.x", | ||
"sinon": "~1.12.2", | ||
"sinon-chai": "~2.6.0" | ||
}, | ||
@@ -34,0 +35,0 @@ "scripts": { |
# cls-fibers | ||
Make continuation-local-storage play nice with node-fibers. | ||
Make [continuation-local-storage](https://github.com/othiym23/node-continuation-local-storage) play nice with [node-fibers](https://github.com/laverdet/node-fibers). | ||
@@ -5,0 +5,0 @@ [![NPM version](http://img.shields.io/npm/v/cls-fibers.svg?style=flat-square)](https://www.npmjs.org/package/cls-fibers) |
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
12713
1
11
101
7
1