Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(666)

Unified Diff: src/debug.h

Issue 440773004: Trigger exception debug events on Promise reject. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: comments Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.h
diff --git a/src/debug.h b/src/debug.h
index 18d069313942b5c7152bee4721b11b84d4a869da..e60e1aaab8f008064321746ce84f1cd94d16b46a 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -335,17 +335,16 @@ class LockingCommandMessageQueue BASE_EMBEDDED {
class PromiseOnStack {
public:
- PromiseOnStack(Isolate* isolate,
- PromiseOnStack* prev,
- Handle<JSFunction> getter);
+ PromiseOnStack(Isolate* isolate, PromiseOnStack* prev,
+ Handle<JSObject> getter);
~PromiseOnStack();
StackHandler* handler() { return handler_; }
- Handle<JSFunction> getter() { return getter_; }
+ Handle<JSObject> promise() { return promise_; }
PromiseOnStack* prev() { return prev_; }
private:
Isolate* isolate_;
StackHandler* handler_;
- Handle<JSFunction> getter_;
+ Handle<JSObject> promise_;
PromiseOnStack* prev_;
};
@@ -361,7 +360,9 @@ class Debug {
public:
// Debug event triggers.
void OnDebugBreak(Handle<Object> break_points_hit, bool auto_continue);
- void OnException(Handle<Object> exception, bool uncaught);
+
+ void OnThrow(Handle<Object> exception, bool uncaught);
+ void OnPromiseReject(Handle<JSObject> promise, Handle<Object> value);
void OnCompileError(Handle<Script> script);
void OnBeforeCompile(Handle<Script> script);
void OnAfterCompile(Handle<Script> script);
@@ -452,8 +453,9 @@ class Debug {
bool IsBreakAtReturn(JavaScriptFrame* frame);
// Promise handling.
- void PromiseHandlePrologue(Handle<JSFunction> promise_getter);
- void PromiseHandleEpilogue();
+ // Push and pop a promise and the current try-catch handler.
+ void PushPromise(Handle<JSObject> promise);
+ void PopPromise();
// Support for LiveEdit
void FramesHaveBeenDropped(StackFrame::Id new_break_frame_id,
@@ -523,6 +525,9 @@ class Debug {
inline bool has_commands() const { return !command_queue_.IsEmpty(); }
inline bool ignore_events() const { return is_suppressed_ || !is_active_; }
+ void OnException(Handle<Object> exception, bool uncaught,
+ Handle<Object> promise);
+
// Constructors for debug event objects.
MUST_USE_RESULT MaybeHandle<Object> MakeJSObject(
const char* constructor_name,
@@ -545,8 +550,9 @@ class Debug {
// Mirror cache handling.
void ClearMirrorCache();
- // Returns a promise if it does not have a reject handler.
- Handle<Object> GetPromiseForUncaughtException();
+ // Returns a promise if the pushed try-catch handler matches the current one.
+ Handle<Object> GetPromiseOnStackOnThrow();
+ bool PromiseHasRejectHandler(Handle<JSObject> promise);
void CallEventCallback(v8::DebugEvent event,
Handle<Object> exec_state,
« no previous file with comments | « no previous file | src/debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698