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

Side by Side Diff: src/js/async-await.js

Issue 2451163003: [promises] Move PromiseReject to c++ (Closed)
Patch Set: make promise a jsobject Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « src/globals.h ('k') | src/js/promise.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 (function(global, utils, extrasUtils) { 5 (function(global, utils, extrasUtils) {
6 6
7 "use strict"; 7 "use strict";
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // prediction indicates that there is a locally surrounding catch block 123 // prediction indicates that there is a locally surrounding catch block
124 function AsyncFunctionAwaitCaught(generator, awaited, outerPromise) { 124 function AsyncFunctionAwaitCaught(generator, awaited, outerPromise) {
125 if (DEBUG_IS_ACTIVE && IsPromise(awaited)) { 125 if (DEBUG_IS_ACTIVE && IsPromise(awaited)) {
126 SET_PRIVATE(awaited, promiseHandledHintSymbol, true); 126 SET_PRIVATE(awaited, promiseHandledHintSymbol, true);
127 } 127 }
128 AsyncFunctionAwait(generator, awaited, outerPromise); 128 AsyncFunctionAwait(generator, awaited, outerPromise);
129 } 129 }
130 130
131 // How the parser rejects promises from async/await desugaring 131 // How the parser rejects promises from async/await desugaring
132 function RejectPromiseNoDebugEvent(promise, reason) { 132 function RejectPromiseNoDebugEvent(promise, reason) {
133 return RejectPromise(promise, reason, false); 133 return RejectPromise(promise, reason);
134 } 134 }
135 135
136 function AsyncFunctionPromiseCreate() { 136 function AsyncFunctionPromiseCreate() {
137 var promise = PromiseCreate(); 137 var promise = PromiseCreate();
138 if (DEBUG_IS_ACTIVE) { 138 if (DEBUG_IS_ACTIVE) {
139 // Push the Promise under construction in an async function on 139 // Push the Promise under construction in an async function on
140 // the catch prediction stack to handle exceptions thrown before 140 // the catch prediction stack to handle exceptions thrown before
141 // the first await. 141 // the first await.
142 %DebugPushPromise(promise); 142 %DebugPushPromise(promise);
143 // Assign ID and create a recurring task to save stack for future 143 // Assign ID and create a recurring task to save stack for future
(...skipping 23 matching lines...) Expand all
167 167
168 %InstallToContext([ 168 %InstallToContext([
169 "async_function_await_caught", AsyncFunctionAwaitCaught, 169 "async_function_await_caught", AsyncFunctionAwaitCaught,
170 "async_function_await_uncaught", AsyncFunctionAwaitUncaught, 170 "async_function_await_uncaught", AsyncFunctionAwaitUncaught,
171 "reject_promise_no_debug_event", RejectPromiseNoDebugEvent, 171 "reject_promise_no_debug_event", RejectPromiseNoDebugEvent,
172 "async_function_promise_create", AsyncFunctionPromiseCreate, 172 "async_function_promise_create", AsyncFunctionPromiseCreate,
173 "async_function_promise_release", AsyncFunctionPromiseRelease, 173 "async_function_promise_release", AsyncFunctionPromiseRelease,
174 ]); 174 ]);
175 175
176 }) 176 })
OLDNEW
« no previous file with comments | « src/globals.h ('k') | src/js/promise.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698