OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #include "src/isolate.h" | 5 #include "src/isolate.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include <fstream> // NOLINT(readability/streams) | 9 #include <fstream> // NOLINT(readability/streams) |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 3151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3162 // Fire callbacks. Increase call depth to prevent recursive callbacks. | 3162 // Fire callbacks. Increase call depth to prevent recursive callbacks. |
3163 v8::Isolate* isolate = reinterpret_cast<v8::Isolate*>(this); | 3163 v8::Isolate* isolate = reinterpret_cast<v8::Isolate*>(this); |
3164 v8::Isolate::SuppressMicrotaskExecutionScope suppress(isolate); | 3164 v8::Isolate::SuppressMicrotaskExecutionScope suppress(isolate); |
3165 for (int i = 0; i < call_completed_callbacks_.length(); i++) { | 3165 for (int i = 0; i < call_completed_callbacks_.length(); i++) { |
3166 call_completed_callbacks_.at(i)(isolate); | 3166 call_completed_callbacks_.at(i)(isolate); |
3167 } | 3167 } |
3168 } | 3168 } |
3169 | 3169 |
3170 void Isolate::SetPromiseHook(PromiseHook hook) { promise_hook_ = hook; } | 3170 void Isolate::SetPromiseHook(PromiseHook hook) { promise_hook_ = hook; } |
3171 | 3171 |
3172 void Isolate::RunPromiseHook(PromiseHookType type, Handle<JSPromise> promise, | 3172 void Isolate::RunPromiseHook(PromiseHookType type, Handle<JSObject> promise, |
3173 Handle<Object> parent) { | 3173 Handle<Object> parent) { |
3174 if (promise_hook_ == nullptr) return; | 3174 if (promise_hook_ == nullptr) return; |
3175 promise_hook_(type, v8::Utils::PromiseToLocal(promise), | 3175 promise_hook_(type, v8::Utils::PromiseToLocal(promise), |
3176 v8::Utils::ToLocal(parent)); | 3176 v8::Utils::ToLocal(parent)); |
3177 } | 3177 } |
3178 | 3178 |
3179 void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) { | 3179 void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) { |
3180 promise_reject_callback_ = callback; | 3180 promise_reject_callback_ = callback; |
3181 } | 3181 } |
3182 | 3182 |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3585 // Then check whether this scope intercepts. | 3585 // Then check whether this scope intercepts. |
3586 if ((flag & intercept_mask_)) { | 3586 if ((flag & intercept_mask_)) { |
3587 intercepted_flags_ |= flag; | 3587 intercepted_flags_ |= flag; |
3588 return true; | 3588 return true; |
3589 } | 3589 } |
3590 return false; | 3590 return false; |
3591 } | 3591 } |
3592 | 3592 |
3593 } // namespace internal | 3593 } // namespace internal |
3594 } // namespace v8 | 3594 } // namespace v8 |
OLD | NEW |