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

Unified Diff: src/js/promise.js

Issue 2425553003: Move PromiseNextMicrotaskID to cpp (Closed)
Patch Set: Fix build Created 4 years, 2 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/js/async-await.js ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/promise.js
diff --git a/src/js/promise.js b/src/js/promise.js
index 0cde9320e2c2da25395a7f9d3b19401603625a51..dc6d8bf534287f7219f5f91a24965852eab70515 100644
--- a/src/js/promise.js
+++ b/src/js/promise.js
@@ -48,12 +48,6 @@ const kPending = 0;
const kFulfilled = +1;
const kRejected = -1;
-var lastMicrotaskId = 0;
-
-function PromiseNextMicrotaskID() {
- return ++lastMicrotaskId;
-}
-
// ES#sec-createresolvingfunctions
// CreateResolvingFunctions ( promise )
function CreateResolvingFunctions(promise, debugEvent) {
@@ -202,7 +196,7 @@ function PromiseEnqueue(value, tasks, deferreds, status) {
promiseAsyncStackIDSymbol);
name = "async function";
} else {
- id = PromiseNextMicrotaskID();
+ id = %DebugNextMicrotaskId();
name = status === kFulfilled ? "Promise.resolve" : "Promise.reject";
%DebugAsyncTaskEvent("enqueue", id, name);
}
@@ -307,7 +301,7 @@ function ResolvePromise(promise, resolution) {
// Mark the dependency of the new promise on the resolution
SET_PRIVATE(resolution, promiseHandledBySymbol, promise);
}
- id = PromiseNextMicrotaskID();
+ id = %DebugNextMicrotaskId();
name = "PromiseResolveThenableJob";
%DebugAsyncTaskEvent("enqueue", id, name);
}
@@ -687,7 +681,6 @@ utils.Export(function(to) {
to.IsPromise = IsPromise;
to.PromiseCreate = PromiseCreate;
to.PromiseThen = PromiseThen;
- to.PromiseNextMicrotaskID = PromiseNextMicrotaskID;
to.GlobalPromise = GlobalPromise;
to.NewPromiseCapability = NewPromiseCapability;
« no previous file with comments | « src/js/async-await.js ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698