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

Unified Diff: src/js/promise.js

Issue 2233923003: Desugar async/await to create the resulting Promise upfront (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: format Created 4 years, 4 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/prologue.js ('k') | src/parsing/parser.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 c86cee5d4a0a4edaf078ff07802c90debf65f124..c057238af696d78416a6198b3c0f68dabb8c31c1 100644
--- a/src/js/promise.js
+++ b/src/js/promise.js
@@ -381,22 +381,6 @@ function PromiseReject(r) {
}
}
-// Shortcut Promise.reject and Promise.resolve() implementations, used by
-// Async Functions implementation.
-function PromiseCreateRejected(r) {
- var promise = PromiseCreateAndSet(kRejected, r);
- // This is called from the desugaring of async/await; no reason to
- // create a redundant reject event.
- %PromiseRejectEvent(promise, r, false);
- return promise;
-}
-
-function PromiseCreateResolved(value) {
- var promise = PromiseInit(new GlobalPromise(promiseRawSymbol));
- var resolveResult = ResolvePromise(promise, value);
- return promise;
-}
-
function PromiseCastResolved(value) {
if (IsPromise(value)) {
return value;
@@ -627,8 +611,6 @@ utils.InstallFunctions(GlobalPromise.prototype, DONT_ENUM, [
"promise_reject", DoRejectPromise,
"promise_resolve", ResolvePromise,
"promise_then", PromiseThen,
- "promise_create_rejected", PromiseCreateRejected,
- "promise_create_resolved", PromiseCreateResolved
]);
// This allows extras to create promises quickly without building extra
@@ -647,6 +629,7 @@ utils.Export(function(to) {
to.GlobalPromise = GlobalPromise;
to.NewPromiseCapability = NewPromiseCapability;
to.PerformPromiseThen = PerformPromiseThen;
+ to.RejectPromise = RejectPromise;
});
})
« no previous file with comments | « src/js/prologue.js ('k') | src/parsing/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698