Comparing version 0.1.7 to 0.1.8
@@ -426,3 +426,3 @@ /*global setTimeout: false, console: false */ | ||
} | ||
callback.call(null, err, args || null); | ||
callback.call(null, err, args); | ||
}); | ||
@@ -459,3 +459,3 @@ } | ||
} | ||
callback.call(null, err, args || null); | ||
callback.call(null, err, args); | ||
}); | ||
@@ -462,0 +462,0 @@ } |
@@ -5,3 +5,3 @@ { "name": "async" | ||
, "author": "Caolan McMahon" | ||
, "version": "0.1.7" | ||
, "version": "0.1.8" | ||
, "repository" : | ||
@@ -8,0 +8,0 @@ { "type" : "git" |
@@ -1252,1 +1252,71 @@ var async = require('../lib/async'); | ||
}; | ||
// Issue 10 on github: https://github.com/caolan/async/issues#issue/10 | ||
exports['falsy return values in series'] = function (test) { | ||
function taskFalse(callback) { | ||
process.nextTick(function() { | ||
callback(null, false); | ||
}); | ||
}; | ||
function taskUndefined(callback) { | ||
process.nextTick(function() { | ||
callback(null, undefined); | ||
}); | ||
}; | ||
function taskEmpty(callback) { | ||
process.nextTick(function() { | ||
callback(null); | ||
}); | ||
}; | ||
function taskNull(callback) { | ||
process.nextTick(function() { | ||
callback(null, null); | ||
}); | ||
}; | ||
async.series( | ||
[taskFalse, taskUndefined, taskEmpty, taskNull], | ||
function(err, results) { | ||
test.same(results, [false, undefined, undefined, null]); | ||
test.strictEqual(results[0], false); | ||
test.strictEqual(results[1], undefined); | ||
test.strictEqual(results[2], undefined); | ||
test.strictEqual(results[3], null); | ||
test.done(); | ||
} | ||
); | ||
}; | ||
// Issue 10 on github: https://github.com/caolan/async/issues#issue/10 | ||
exports['falsy return values in parallel'] = function (test) { | ||
function taskFalse(callback) { | ||
process.nextTick(function() { | ||
callback(null, false); | ||
}); | ||
}; | ||
function taskUndefined(callback) { | ||
process.nextTick(function() { | ||
callback(null, undefined); | ||
}); | ||
}; | ||
function taskEmpty(callback) { | ||
process.nextTick(function() { | ||
callback(null); | ||
}); | ||
}; | ||
function taskNull(callback) { | ||
process.nextTick(function() { | ||
callback(null, null); | ||
}); | ||
}; | ||
async.parallel( | ||
[taskFalse, taskUndefined, taskEmpty, taskNull], | ||
function(err, results) { | ||
test.same(results, [false, undefined, undefined, null]); | ||
test.strictEqual(results[0], false); | ||
test.strictEqual(results[1], undefined); | ||
test.strictEqual(results[2], undefined); | ||
test.strictEqual(results[3], null); | ||
test.done(); | ||
} | ||
); | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
3544
0
257440
16