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

Unified Diff: src/runtime.cc

Issue 13720: Changed the debugger break handling to support situations where there are no ... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years 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
Index: src/runtime.cc
===================================================================
--- src/runtime.cc (revision 950)
+++ src/runtime.cc (working copy)
@@ -4758,10 +4758,8 @@
static Object* Runtime_CheckExecutionState(Arguments args) {
ASSERT(args.length() >= 1);
CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]);
- // Check that the break id is valid and that there is a valid frame
- // where execution is broken.
- if (break_id != Top::break_id() ||
- Top::break_frame_id() == StackFrame::NO_ID) {
+ // Check that the break id is valid.
+ if (Top::break_id() == 0 || break_id != Top::break_id()) {
return Top::Throw(Heap::illegal_execution_state_symbol());
}
@@ -4780,6 +4778,10 @@
// Count all frames which are relevant to debugging stack trace.
int n = 0;
StackFrame::Id id = Top::break_frame_id();
+ if (id == StackFrame::NO_ID) {
+ // If there is no JavaScript stack frame count is 0.
+ return Smi::FromInt(0);
+ }
for (JavaScriptFrameIterator it(id); !it.done(); it.Advance()) n++;
return Smi::FromInt(n);
}
@@ -4821,6 +4823,10 @@
// Find the relevant frame with the requested index.
StackFrame::Id id = Top::break_frame_id();
+ if (id == StackFrame::NO_ID) {
+ // If there is no JavaScript stack frame is undefined.
Mads Ager (chromium) 2008/12/11 07:56:54 is -> return?
Søren Thygesen Gjesse 2008/12/11 08:04:49 Done.
+ return Heap::undefined_value();
+ }
int count = 0;
JavaScriptFrameIterator it(id);
for (; !it.done(); it.Advance()) {

Powered by Google App Engine
This is Rietveld 408576698