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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 var onRejected = sentError => { | 75 var onRejected = sentError => { |
76 %_Call(AsyncFunctionThrow, generator, sentError); | 76 %_Call(AsyncFunctionThrow, generator, sentError); |
77 // Similarly, returning the huge Promise here would cause a long | 77 // Similarly, returning the huge Promise here would cause a long |
78 // resolution chain to find what the exception to throw is, and | 78 // resolution chain to find what the exception to throw is, and |
79 // create a similar memory leak, and it does not matter what | 79 // create a similar memory leak, and it does not matter what |
80 // sort of rejection this intermediate Promise becomes. | 80 // sort of rejection this intermediate Promise becomes. |
81 return; | 81 return; |
82 } | 82 } |
83 | 83 |
84 // Just forwarding the exception, so no debugEvent for throwawayCapability. | 84 // Just forwarding the exception, so no debugEvent for throwawayCapability. |
85 var throwawayCapability = CreateInternalPromiseCapability(); | 85 var throwawayCapability = CreateInternalPromiseCapability(promise); |
86 | 86 |
87 // The Promise will be thrown away and not handled, but it shouldn't trigger | 87 // The Promise will be thrown away and not handled, but it shouldn't trigger |
88 // unhandled reject events as its work is done | 88 // unhandled reject events as its work is done |
89 %PromiseMarkAsHandled(throwawayCapability.promise); | 89 %PromiseMarkAsHandled(throwawayCapability.promise); |
90 | 90 |
91 if (DEBUG_IS_ACTIVE) { | 91 if (DEBUG_IS_ACTIVE) { |
92 if (%is_promise(awaited)) { | 92 if (%is_promise(awaited)) { |
93 // Mark the reject handler callback to be a forwarding edge, rather | 93 // Mark the reject handler callback to be a forwarding edge, rather |
94 // than a meaningful catch handler | 94 // than a meaningful catch handler |
95 SET_PRIVATE(onRejected, promiseForwardingHandlerSymbol, true); | 95 SET_PRIVATE(onRejected, promiseForwardingHandlerSymbol, true); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 158 |
159 %InstallToContext([ | 159 %InstallToContext([ |
160 "async_function_await_caught", AsyncFunctionAwaitCaught, | 160 "async_function_await_caught", AsyncFunctionAwaitCaught, |
161 "async_function_await_uncaught", AsyncFunctionAwaitUncaught, | 161 "async_function_await_uncaught", AsyncFunctionAwaitUncaught, |
162 "reject_promise_no_debug_event", RejectPromiseNoDebugEvent, | 162 "reject_promise_no_debug_event", RejectPromiseNoDebugEvent, |
163 "async_function_promise_create", AsyncFunctionPromiseCreate, | 163 "async_function_promise_create", AsyncFunctionPromiseCreate, |
164 "async_function_promise_release", AsyncFunctionPromiseRelease, | 164 "async_function_promise_release", AsyncFunctionPromiseRelease, |
165 ]); | 165 ]); |
166 | 166 |
167 }) | 167 }) |
OLD | NEW |