Remove setImmediate use from _.defer.

This commit is contained in:
John-David Dalton
2013-11-24 15:31:34 -06:00
parent 97ea15300c
commit 86075973b5
7 changed files with 264 additions and 290 deletions

View File

@@ -78,7 +78,7 @@
var contextProps = [
'Array', 'Boolean', 'Date', 'Error', 'Function', 'Math', 'Number', 'Object',
'RegExp', 'String', '_', 'attachEvent', 'clearTimeout', 'isFinite', 'isNaN',
'parseInt', 'setImmediate', 'setTimeout'
'parseInt', 'setTimeout'
];
/** Used to fix the JScript [[DontEnum]] bug */
@@ -525,10 +525,6 @@
splice = arrayRef.splice,
unshift = arrayRef.unshift;
/** Used to detect `setImmediate` in Node.js */
var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' &&
!reNative.test(setImmediate) && setImmediate;
/** Used to set meta data on functions */
var defineProperty = (function() {
// IE 8 only accepts DOM elements
@@ -5848,15 +5844,6 @@
var args = slice(arguments, 1);
return setTimeout(function() { func.apply(undefined, args); }, 1);
}
// use `setImmediate` if available in Node.js
if (setImmediate) {
defer = function(func) {
if (!isFunction(func)) {
throw new TypeError;
}
return setImmediate.apply(context, arguments);
};
}
/**
* Executes the `func` function after `wait` milliseconds. Additional arguments