Index: src/v8natives.js |
diff --git a/src/v8natives.js b/src/v8natives.js |
index b0b66e760b32118be5876b223a3292844a0ae439..b9f96df7002ff2538a4d61bec25321ae58f1396e 100644 |
--- a/src/v8natives.js |
+++ b/src/v8natives.js |
@@ -1904,10 +1904,15 @@ SetUpFunction(); |
// Eventually, we should move to a real event queue that allows to maintain |
// relative ordering of different kinds of tasks. |
-RunMicrotasks.runners = new InternalArray; |
+RunMicrotasks.queue = new InternalArray; |
function RunMicrotasks() { |
- while (%SetMicrotaskPending(false)) { |
- for (var i in RunMicrotasks.runners) RunMicrotasks.runners[i](); |
+ while (RunMicrotasks.queue.length) { |
+ var microtasks = RunMicrotasks.queue; |
+ RunMicrotasks.queue = new InternalArray; |
rafaelw
2014/01/24 00:18:34
I'm tempted to avoid allocating a new InternalArra
|
+ |
+ for (var i = 0; i < microtasks.length; i++) { |
+ microtasks[i](); |
+ } |
} |
} |