[Pkg-javascript-commits] [node-async] 66/480: Changed async.nextTick to be defined once based on whether process.nextTick is available.

Jonas Smedegaard js at moszumanska.debian.org
Fri May 2 08:58:13 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 b2d7e69fe289d4dc66feedd4bb3193849712948c
Author: kpozin <kpozin at gmail.com>
Date:   Fri Dec 17 02:39:38 2010 +0800

    Changed async.nextTick to be defined once based on whether process.nextTick is available.
---
 lib/async.js | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/lib/async.js b/lib/async.js
index 5314372..bf78579 100644
--- a/lib/async.js
+++ b/lib/async.js
@@ -79,14 +79,9 @@
     //// exported async module functions ////
 
     //// nextTick implementation with browser-compatible fallback ////
-    async.nextTick = function (fn) {
-        if (typeof process === 'undefined' || !(process.nextTick)) {
-            setTimeout(fn, 0);
-        }
-        else {
-            process.nextTick(fn);
-        }
-    };
+    async.nextTick = (typeof process === 'undefined' || !(process.nextTick)) ?
+				     function(fn) { setTimeout(fn, 0); } :
+					 function(fn) { process.nextTick(fn) };
 
     async.forEach = function (arr, iterator, callback) {
         if (!arr.length) {

-- 
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