mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 10:17:48 +00:00
Remove setImmediate use from _.defer.
This commit is contained in:
15
lodash.js
15
lodash.js
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user