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

Unified Diff: src/debug-debugger.js

Issue 357603005: Introduce debug events for promises. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebase and addressed comments Created 6 years, 6 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 | « src/debug.cc ('k') | src/promise.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug-debugger.js
diff --git a/src/debug-debugger.js b/src/debug-debugger.js
index 5de829221a8392bac8102e2098c10ade132aff2f..8afac2e20af6c648b15a03d18c15c698ef5042ca 100644
--- a/src/debug-debugger.js
+++ b/src/debug-debugger.js
@@ -19,7 +19,8 @@ Debug.DebugEvent = { Break: 1,
NewFunction: 3,
BeforeCompile: 4,
AfterCompile: 5,
- CompileError: 6 };
+ CompileError: 6,
+ PromiseEvent: 7 };
// Types of exceptions that can be broken upon.
Debug.ExceptionBreak = { Caught : 0,
@@ -1199,6 +1200,32 @@ function MakeScriptObject_(script, include_source) {
}
+function MakePromiseEvent(event_data) {
+ if (event_data.type = "new Promise") {
+ return new NewPromiseEvent(event_data);
+ }
+}
+
+
+function PromiseGetter() {
+ return MakeMirror(this.promise_);
+}
+
+
+function NewPromiseEvent(event_data) {
+ this.resolver_ = event_data.resolver;
+ this.promise_ = event_data.promise;
+}
+
+
+NewPromiseEvent.prototype.promise = PromiseGetter;
+
+
+NewPromiseEvent.prototype.resolver = function() {
+ return MakeMirror(this.resolver_);
+}
+
+
function DebugCommandProcessor(exec_state, opt_is_running) {
this.exec_state_ = exec_state;
this.running_ = opt_is_running || false;
« no previous file with comments | « src/debug.cc ('k') | src/promise.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698