/**
 * Creates a delayed version of the provided function. This is used to guarantee
 * ansynchronous behavior for potentially synchronous operations.
 */
function delayed(fn) {
  return function() {
    var args = arguments;
    var self = this;
    var fnWithArgs = function() {
      fn.apply(self, args);
    };
    setTimeout(fnWithArgs, 0);
  };
}

module.exports = delayed;

@@ -1,8 +1,112 @@
+var delay = typeof setImmediate === 'function' ? setImmediate : function(fn) %7B%0A  setTimeout(fn, 0);%0A%7D;%0A%0A
 /**%0A * C
@@ -417,26 +417,21 @@
  %7D;%0A    
-setTimeout
+delay
 (fnWithA
@@ -433,19 +433,16 @@
 WithArgs
-, 0
 );%0A  %7D;%0A

Use setImmediate if available