timers: setImmediate v8 optimization fix
Prevent v8 disabling optimization for scenario "bad value context for arguments value". Solves #6631 Signed-off-by: Trevor Norris <trev.norris@gmail.com>
This commit is contained in:
parent
8d3bc88bbe
commit
7ced966a32
@ -424,14 +424,16 @@ Immediate.prototype._idlePrev = undefined;
|
||||
|
||||
exports.setImmediate = function(callback) {
|
||||
var immediate = new Immediate();
|
||||
var args;
|
||||
var args, index;
|
||||
|
||||
L.init(immediate);
|
||||
|
||||
immediate._onImmediate = callback;
|
||||
|
||||
if (arguments.length > 1) {
|
||||
args = Array.prototype.slice.call(arguments, 1);
|
||||
args = [];
|
||||
for (index = 1; index < arguments.length; index++)
|
||||
args.push(arguments[index]);
|
||||
|
||||
immediate._onImmediate = function() {
|
||||
callback.apply(immediate, args);
|
||||
|
Loading…
x
Reference in New Issue
Block a user