Chromium Code Reviews| 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()) { |