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

Unified Diff: include/v8.h

Issue 630373003: Add stack trace to the promise reject callback. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 6 years, 2 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/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 7a1c479cc427d69abeecd1e235f2e979e1859e3c..03eab7872fd2b2ccd1796a5acd413b936f75f065 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -4214,9 +4214,28 @@ enum PromiseRejectEvent {
kPromiseHandlerAddedAfterReject = 1
};
-typedef void (*PromiseRejectCallback)(Handle<Promise> promise,
- Handle<Value> value,
- PromiseRejectEvent event);
+class PromiseRejectMessage {
+ public:
+ PromiseRejectMessage(Handle<Promise> promise, PromiseRejectEvent event,
+ Handle<Value> value, Handle<StackTrace> stack_trace)
+ : promise_(promise),
+ event_(event),
+ value_(value),
+ stack_trace_(stack_trace) {}
+
+ V8_INLINE Handle<Promise> GetPromise() const { return promise_; }
+ V8_INLINE PromiseRejectEvent GetEvent() const { return event_; }
+ V8_INLINE Handle<Value> GetValue() const { return value_; }
+ V8_INLINE Handle<StackTrace> GetStackTrace() const { return stack_trace_; }
+
+ private:
+ Handle<Promise> promise_;
+ PromiseRejectEvent event_;
+ Handle<Value> value_;
+ Handle<StackTrace> stack_trace_;
+};
+
+typedef void (*PromiseRejectCallback)(PromiseRejectMessage message);
// --- Microtask Callback ---
typedef void (*MicrotaskCallback)(void* data);
« no previous file with comments | « no previous file | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698