Comparing version 3.2.2 to 3.2.3
@@ -15,4 +15,7 @@ 'use strict'; | ||
function cleanUpNextTick() { | ||
if (!draining || !currentQueue) { | ||
return; | ||
} | ||
draining = false; | ||
if (currentQueue && currentQueue.length) { | ||
if (currentQueue.length) { | ||
queue = currentQueue.concat(queue); | ||
@@ -29,2 +32,5 @@ } else { | ||
function nextTick() { | ||
if (draining) { | ||
return; | ||
} | ||
scheduled = false; | ||
@@ -37,3 +43,3 @@ draining = true; | ||
queue = []; | ||
while (++queueIndex < len) { | ||
while (currentQueue && ++queueIndex < len) { | ||
currentQueue[queueIndex].run(); | ||
@@ -44,2 +50,3 @@ } | ||
} | ||
currentQueue = null; | ||
queueIndex = -1; | ||
@@ -64,3 +71,17 @@ draining = false; | ||
Item.prototype.run = function () { | ||
this.fun.apply(null, this.array); | ||
var fun = this.fun; | ||
var array = this.array; | ||
switch (array.length) { | ||
case 0: | ||
return fun(); | ||
case 1: | ||
return fun(array[0]); | ||
case 2: | ||
return fun(array[0], array[1]); | ||
case 3: | ||
return fun(array[0], array[1], array[2]); | ||
default: | ||
return fun.apply(null, array); | ||
} | ||
}; | ||
@@ -67,0 +88,0 @@ module.exports = immediate; |
{ | ||
"name": "immediate", | ||
"version": "3.2.2", | ||
"version": "3.2.3", | ||
"description": "A cross browser microtask library", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21279
15
442