[Pkg-javascript-commits] [node-async] 431/480: detect functions coming from other JavaScript contexts
Jonas Smedegaard
js at moszumanska.debian.org
Fri May 2 08:58:49 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository node-async.
commit e6e3434570773a7552bec9a6354005611ffa264a
Author: Mithgol <getgit at mithgol.ru>
Date: Sun Mar 30 11:01:32 2014 -0700
detect functions coming from other JavaScript contexts
---
lib/async.js | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lib/async.js b/lib/async.js
index c9f355f..bca33c6 100755
--- a/lib/async.js
+++ b/lib/async.js
@@ -32,6 +32,11 @@
return toString.call(obj) === '[object Array]';
};
+ var _isFunction = function (obj) {
+ return obj instanceof Function ||
+ toString.call(obj) === '[object Function]';
+ };
+
var _each = function (arr, iterator) {
if (arr.forEach) {
return arr.forEach(iterator);
@@ -439,7 +444,7 @@
});
_each(keys, function (k) {
- var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k];
+ var task = _isFunction(tasks[k]) ? [tasks[k]]: tasks[k];
var taskCallback = function (err) {
var args = Array.prototype.slice.call(arguments, 1);
if (args.length <= 1) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-async.git
More information about the Pkg-javascript-commits
mailing list