Reviewers: Mads Ager,

Description:
Add handling of empty stack in the backtrace debug request.

Add accessor function for the exception in an ExceptionEvent.

Please review this at http://codereview.chromium.org/13382

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
   M     src/debug-delay.js


Index: src/debug-delay.js
===================================================================
--- src/debug-delay.js  (revision 960)
+++ src/debug-delay.js  (working copy)
@@ -832,10 +832,16 @@
  };


+ExceptionEvent.prototype.exception = function() {
+  return this.exception_;
+}
+
+
  ExceptionEvent.prototype.uncaught = function() {
    return this.uncaught_;
  }

+
  ExceptionEvent.prototype.func = function() {
    return this.exec_state_.frame(0).func();
  };
@@ -1322,6 +1328,14 @@
    // Get the number of frames.
    var total_frames = this.exec_state_.frameCount();

+  // Create simple response if there are no frames.
+  if (total_frames == 0) {
+    response.body = {
+      totalFrames: total_frames
+    }
+    return;
+  }
+
    // Default frame range to include in backtrace.
    var from_index = 0
    var to_index = kDefaultBacktraceLength;



--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to