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; |