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 #ifndef V8_ISOLATE_H_ | 5 #ifndef V8_ISOLATE_H_ |
6 #define V8_ISOLATE_H_ | 6 #define V8_ISOLATE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <queue> | 9 #include <queue> |
10 | 10 |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 // exceptions. If an exception was thrown and not handled by an external | 668 // exceptions. If an exception was thrown and not handled by an external |
669 // handler the exception is scheduled to be rethrown when we return to running | 669 // handler the exception is scheduled to be rethrown when we return to running |
670 // JavaScript code. If an exception is scheduled true is returned. | 670 // JavaScript code. If an exception is scheduled true is returned. |
671 bool OptionalRescheduleException(bool is_bottom_call); | 671 bool OptionalRescheduleException(bool is_bottom_call); |
672 | 672 |
673 // Push and pop a promise and the current try-catch handler. | 673 // Push and pop a promise and the current try-catch handler. |
674 void PushPromise(Handle<JSObject> promise); | 674 void PushPromise(Handle<JSObject> promise); |
675 void PopPromise(); | 675 void PopPromise(); |
676 Handle<Object> GetPromiseOnStackOnThrow(); | 676 Handle<Object> GetPromiseOnStackOnThrow(); |
677 | 677 |
| 678 // Heuristically guess whether a Promise is handled by user catch handler |
| 679 bool PromiseHasUserDefinedRejectHandler(Handle<Object> promise); |
| 680 |
678 class ExceptionScope { | 681 class ExceptionScope { |
679 public: | 682 public: |
680 // Scope currently can only be used for regular exceptions, | 683 // Scope currently can only be used for regular exceptions, |
681 // not termination exception. | 684 // not termination exception. |
682 inline explicit ExceptionScope(Isolate* isolate); | 685 inline explicit ExceptionScope(Isolate* isolate); |
683 inline ~ExceptionScope(); | 686 inline ~ExceptionScope(); |
684 | 687 |
685 private: | 688 private: |
686 Isolate* isolate_; | 689 Isolate* isolate_; |
687 Handle<Object> pending_exception_; | 690 Handle<Object> pending_exception_; |
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1673 | 1676 |
1674 EmbeddedVector<char, 128> filename_; | 1677 EmbeddedVector<char, 128> filename_; |
1675 FILE* file_; | 1678 FILE* file_; |
1676 int scope_depth_; | 1679 int scope_depth_; |
1677 }; | 1680 }; |
1678 | 1681 |
1679 } // namespace internal | 1682 } // namespace internal |
1680 } // namespace v8 | 1683 } // namespace v8 |
1681 | 1684 |
1682 #endif // V8_ISOLATE_H_ | 1685 #endif // V8_ISOLATE_H_ |
OLD | NEW |