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 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 | 666 |
667 // This method is called by the api after operations that may throw | 667 // This method is called by the api after operations that may throw |
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 |
| 677 // Return the relevant Promise that a throw/rejection pertains to, based |
| 678 // on the contents of the Promise stack |
676 Handle<Object> GetPromiseOnStackOnThrow(); | 679 Handle<Object> GetPromiseOnStackOnThrow(); |
677 | 680 |
| 681 // Heuristically guess whether a Promise is handled by user catch handler |
| 682 bool PromiseHasUserDefinedRejectHandler(Handle<Object> promise); |
| 683 |
678 class ExceptionScope { | 684 class ExceptionScope { |
679 public: | 685 public: |
680 // Scope currently can only be used for regular exceptions, | 686 // Scope currently can only be used for regular exceptions, |
681 // not termination exception. | 687 // not termination exception. |
682 inline explicit ExceptionScope(Isolate* isolate); | 688 inline explicit ExceptionScope(Isolate* isolate); |
683 inline ~ExceptionScope(); | 689 inline ~ExceptionScope(); |
684 | 690 |
685 private: | 691 private: |
686 Isolate* isolate_; | 692 Isolate* isolate_; |
687 Handle<Object> pending_exception_; | 693 Handle<Object> pending_exception_; |
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1681 | 1687 |
1682 EmbeddedVector<char, 128> filename_; | 1688 EmbeddedVector<char, 128> filename_; |
1683 FILE* file_; | 1689 FILE* file_; |
1684 int scope_depth_; | 1690 int scope_depth_; |
1685 }; | 1691 }; |
1686 | 1692 |
1687 } // namespace internal | 1693 } // namespace internal |
1688 } // namespace v8 | 1694 } // namespace v8 |
1689 | 1695 |
1690 #endif // V8_ISOLATE_H_ | 1696 #endif // V8_ISOLATE_H_ |
OLD | NEW |