Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Unified Diff: src/v8natives.js

Issue 250883002: Fix |RunMicrotasks()| leaking reference to the last context being run on. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: remove external_ Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/promise.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « src/promise.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698