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

Unified Diff: src/js/harmony-async-await.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/full-codegen/full-codegen.cc ('k') | src/js/prologue.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/harmony-async-await.js
diff --git a/src/js/harmony-async-await.js b/src/js/harmony-async-await.js
index 192e041e554fbf8d4a1811848ffa801a94cc695f..203ca88f12201df3fe3a013bed3bc2f8bb61b006 100644
--- a/src/js/harmony-async-await.js
+++ b/src/js/harmony-async-await.js
@@ -17,6 +17,7 @@ var GlobalPromise;
var NewPromiseCapability;
var PerformPromiseThen;
var PromiseCastResolved;
+var RejectPromise;
utils.Import(function(from) {
AsyncFunctionNext = from.AsyncFunctionNext;
@@ -25,6 +26,7 @@ utils.Import(function(from) {
NewPromiseCapability = from.NewPromiseCapability;
PromiseCastResolved = from.PromiseCastResolved;
PerformPromiseThen = from.PerformPromiseThen;
+ RejectPromise = from.RejectPromise;
});
// -------------------------------------------------------------------
@@ -47,6 +49,14 @@ function AsyncFunctionAwait(generator, value) {
throwawayCapability);
}
-%InstallToContext([ "async_function_await", AsyncFunctionAwait ]);
+// How the parser rejects promises from async/await desugaring
+function RejectPromiseNoDebugEvent(promise, reason) {
+ return RejectPromise(promise, reason, false);
+}
+
+%InstallToContext([
+ "async_function_await", AsyncFunctionAwait,
+ "reject_promise_no_debug_event", RejectPromiseNoDebugEvent,
+]);
})
« no previous file with comments | « src/full-codegen/full-codegen.cc ('k') | src/js/prologue.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698