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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 name: "async function", | 151 name: "async function", |
152 }); | 152 }); |
153 } | 153 } |
154 return promise; | 154 return promise; |
155 } | 155 } |
156 | 156 |
157 function AsyncFunctionPromiseRelease(promise) { | 157 function AsyncFunctionPromiseRelease(promise) { |
158 if (DEBUG_IS_ACTIVE) { | 158 if (DEBUG_IS_ACTIVE) { |
159 // Cancel | 159 // Cancel |
160 var id = GET_PRIVATE(promise, promiseAsyncStackIDSymbol); | 160 var id = GET_PRIVATE(promise, promiseAsyncStackIDSymbol); |
161 %DebugAsyncTaskEvent({ | 161 |
162 type: "cancel", | 162 // Don't send invalid events when catch prediction is turned on in |
163 id: id, | 163 // the middle of some async operation. |
164 name: "async function", | 164 if (!IS_UNDEFINED(id)) { |
165 }); | 165 %DebugAsyncTaskEvent({ |
| 166 type: "cancel", |
| 167 id: id, |
| 168 name: "async function", |
| 169 }); |
| 170 } |
166 // Pop the Promise under construction in an async function on | 171 // Pop the Promise under construction in an async function on |
167 // from catch prediction stack. | 172 // from catch prediction stack. |
168 %DebugPopPromise(); | 173 %DebugPopPromise(); |
169 } | 174 } |
170 } | 175 } |
171 | 176 |
172 %InstallToContext([ | 177 %InstallToContext([ |
173 "async_function_await_caught", AsyncFunctionAwaitCaught, | 178 "async_function_await_caught", AsyncFunctionAwaitCaught, |
174 "async_function_await_uncaught", AsyncFunctionAwaitUncaught, | 179 "async_function_await_uncaught", AsyncFunctionAwaitUncaught, |
175 "reject_promise_no_debug_event", RejectPromiseNoDebugEvent, | 180 "reject_promise_no_debug_event", RejectPromiseNoDebugEvent, |
176 "async_function_promise_create", AsyncFunctionPromiseCreate, | 181 "async_function_promise_create", AsyncFunctionPromiseCreate, |
177 "async_function_promise_release", AsyncFunctionPromiseRelease, | 182 "async_function_promise_release", AsyncFunctionPromiseRelease, |
178 ]); | 183 ]); |
179 | 184 |
180 }) | 185 }) |
OLD | NEW |