Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Changed async.nextTick to be defined once based on whether process.ne…

…xtTick is available.
  • Loading branch information...
commit b2d7e69fe289d4dc66feedd4bb3193849712948c 1 parent eac373d
Konstantin Pozin authored December 17, 2010 caolan committed December 20, 2010

Showing 1 changed file with 3 additions and 8 deletions. Show diff stats Hide diff stats

  1. 11  lib/async.js
11  lib/async.js
@@ -79,14 +79,9 @@
79 79
     //// exported async module functions ////
80 80
 
81 81
     //// nextTick implementation with browser-compatible fallback ////
82  
-    async.nextTick = function (fn) {
83  
-        if (typeof process === 'undefined' || !(process.nextTick)) {
84  
-            setTimeout(fn, 0);
85  
-        }
86  
-        else {
87  
-            process.nextTick(fn);
88  
-        }
89  
-    };
  82
+    async.nextTick = (typeof process === 'undefined' || !(process.nextTick)) ?
  83
+				     function(fn) { setTimeout(fn, 0); } :
  84
+					 function(fn) { process.nextTick(fn) };
90 85
 
91 86
     async.forEach = function (arr, iterator, callback) {
92 87
         if (!arr.length) {

0 notes on commit b2d7e69

Please sign in to comment.
Something went wrong with that request. Please try again.