Author: [EMAIL PROTECTED]
Date: Thu Dec 11 01:35:44 2008
New Revision: 961

Modified:
    branches/bleeding_edge/src/debug-delay.js

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

Add accessor function for the exception in an ExceptionEvent.
Review URL: http://codereview.chromium.org/13382

Modified: branches/bleeding_edge/src/debug-delay.js
==============================================================================
--- branches/bleeding_edge/src/debug-delay.js   (original)
+++ branches/bleeding_edge/src/debug-delay.js   Thu Dec 11 01:35:44 2008
@@ -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();
  };
@@ -1321,6 +1327,14 @@
  DebugCommandProcessor.prototype.backtraceRequest_ = function(request,  
response) {
    // 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

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

Reply via email to