Index: src/v8natives.js |
diff --git a/src/v8natives.js b/src/v8natives.js |
index 995e7d83ed11fe4f21f7c65b413391b83c832b6b..b715e8923ff26184b43d2f5f432e9e5a3cf778d3 100644 |
--- a/src/v8natives.js |
+++ b/src/v8natives.js |
@@ -1837,3 +1837,18 @@ function SetUpFunction() { |
} |
SetUpFunction(); |
+ |
+ |
+//---------------------------------------------------------------------------- |
+ |
+// TODO(rossberg): very simple abstraction for generic microtask queue. |
+// Eventually, we should move to a real event queue that allows to maintain |
+// relative ordering of different kinds of tasks. |
+ |
+RunMicrotasks.runners = new InternalArray; |
+ |
+function RunMicrotasks() { |
+ while (%SetMicrotaskPending(false)) { |
+ for (var i in RunMicrotasks.runners) RunMicrotasks.runners[i](); |
+ } |
+} |