Comparing version 6.1.1 to 6.1.2
20
index.js
@@ -23,4 +23,2 @@ var abbott = require('abbott'); | ||
var taskHandlers = new WeakMap(); | ||
function getCallLine(stack){ | ||
@@ -255,10 +253,5 @@ var index = 0, | ||
return results; | ||
}, []), | ||
async; | ||
}, []); | ||
function complete(error){ | ||
if(!async){ | ||
return defer(complete.bind.apply(complete, [null].concat(Array.from(arguments)))) | ||
} | ||
if(error && righto._debug){ | ||
@@ -277,7 +270,3 @@ context.resolve._error = error; | ||
if(taskHandlers.has(nextCallback)){ | ||
callbacks.push.apply(callbacks, taskHandlers.get(nextCallback)) | ||
} else { | ||
nextCallback.apply(null, results) | ||
} | ||
nextCallback.apply(null, results) | ||
} | ||
@@ -300,5 +289,2 @@ } | ||
} | ||
taskHandlers.set(complete, context.callbacks); | ||
async = true; | ||
} | ||
@@ -362,3 +348,3 @@ | ||
context.callbacks.push(complete); | ||
context.callbacks.push(defer.bind(null, complete)); | ||
@@ -365,0 +351,0 @@ if(context.started++){ |
{ | ||
"name": "righto", | ||
"version": "6.1.1", | ||
"version": "6.1.2", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "directories": { |
@@ -1421,2 +1421,25 @@ var test = require('tape'), | ||
test('get after time elapsed', function(t){ | ||
t.plan(2); | ||
function getThingos(callback){ | ||
asyncify(function(){ | ||
callback(null, [1, 2, 3, 4, 5]); | ||
}); | ||
}; | ||
var thingos = righto(getThingos).get(x => x) | ||
thingos(function(){ | ||
t.pass('Standard callback called') | ||
}) | ||
setTimeout(function(){ | ||
thingos.get(x => x)(function(){ | ||
t.pass('delayed get callback called') | ||
}) | ||
}, 10) | ||
}); | ||
test('handle', function(t){ | ||
@@ -1423,0 +1446,0 @@ t.plan(1); |
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
79537
1982