Browse Source

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>
v0.11.10-release
pflannery 11 years ago
committed by Trevor Norris
parent
commit
7ced966a32
  1. 6
      lib/timers.js

6
lib/timers.js

@ -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…
Cancel
Save