Index: src/v8natives.js |
diff --git a/src/v8natives.js b/src/v8natives.js |
index f183afb968f84df9b11c5438f2cfadc64d20068d..a3b7f39c6adc61ee8ce7243e9d2e0731c960aedc 100644 |
--- a/src/v8natives.js |
+++ b/src/v8natives.js |
@@ -1893,14 +1893,6 @@ SetUpFunction(); |
// Eventually, we should move to a real event queue that allows to maintain |
// relative ordering of different kinds of tasks. |
-function GetMicrotaskQueue() { |
- var microtaskState = %GetMicrotaskState(); |
- if (IS_UNDEFINED(microtaskState.queue)) { |
- microtaskState.queue = new InternalArray; |
- } |
- return microtaskState.queue; |
-} |
- |
function RunMicrotasks() { |
while (%SetMicrotaskPending(false)) { |
var microtaskState = %GetMicrotaskState(); |
@@ -1908,7 +1900,7 @@ function RunMicrotasks() { |
return; |
var microtasks = microtaskState.queue; |
- microtaskState.queue = new InternalArray; |
+ microtaskState.queue = null; |
for (var i = 0; i < microtasks.length; i++) { |
microtasks[i](); |
@@ -1916,7 +1908,11 @@ function RunMicrotasks() { |
} |
} |
-function EnqueueExternalMicrotask(fn) { |
- GetMicrotaskQueue().push(fn); |
+function EnqueueMicrotask(fn) { |
+ var microtaskState = %GetMicrotaskState(); |
+ if (IS_UNDEFINED(microtaskState.queue) || IS_NULL(microtaskState.queue)) { |
+ microtaskState.queue = new InternalArray; |
+ } |
+ microtaskState.queue.push(fn); |
%SetMicrotaskPending(true); |
} |