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

Unified Diff: src/js/async-await.js

Issue 2599003002: [async-await] Remove call indirection in Create and Reject (Closed)
Patch Set: Remove RejectPromise and empty utils.Export call Created 3 years, 11 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 | « no previous file | src/js/promise.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/async-await.js
diff --git a/src/js/async-await.js b/src/js/async-await.js
index 732d5abb94c7d4e64b36f0a008887534d65a4c22..a2923f43c4db8dd2cf04599d00047d14b9416d37 100644
--- a/src/js/async-await.js
+++ b/src/js/async-await.js
@@ -13,15 +13,10 @@
var AsyncFunctionNext;
var AsyncFunctionThrow;
-var PromiseCreate;
-var PromiseNextMicrotaskID;
-var RejectPromise;
utils.Import(function(from) {
AsyncFunctionNext = from.AsyncFunctionNext;
AsyncFunctionThrow = from.AsyncFunctionThrow;
- PromiseCreate = from.PromiseCreate;
- RejectPromise = from.RejectPromise;
});
var promiseAsyncStackIDSymbol =
@@ -38,7 +33,7 @@ function PromiseCastResolved(value) {
if (%is_promise(value)) {
return value;
} else {
- var promise = PromiseCreate(UNDEFINED);
+ var promise = %promise_internal_constructor(UNDEFINED);
%promise_resolve(promise, value);
return promise;
}
@@ -77,7 +72,7 @@ function AsyncFunctionAwait(generator, awaited, outerPromise) {
return;
}
- var throwawayPromise = PromiseCreate(promise);
+ var throwawayPromise = %promise_internal_constructor(promise);
// The Promise will be thrown away and not handled, but it shouldn't trigger
// unhandled reject events as its work is done
@@ -115,11 +110,11 @@ function AsyncFunctionAwaitCaught(generator, awaited, outerPromise) {
// How the parser rejects promises from async/await desugaring
function RejectPromiseNoDebugEvent(promise, reason) {
- return RejectPromise(promise, reason, false);
+ return %PromiseReject(promise, reason, false);
}
function AsyncFunctionPromiseCreate() {
- var promise = PromiseCreate();
+ var promise = %promise_internal_constructor(UNDEFINED);
if (DEBUG_IS_ACTIVE) {
// Push the Promise under construction in an async function on
// the catch prediction stack to handle exceptions thrown before
« no previous file with comments | « no previous file | src/js/promise.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698