OLD | NEW |
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 Loading... |
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 Loading... |
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 }) |
OLD | NEW |