Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index e4a9c219e3801edf43d130c4ba0c17a368206318..0904bf24644f967ecfba2f2ad052747a7738c56e 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -12550,7 +12550,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_IsBreakOnException) { |
// of frames to step down. |
RUNTIME_FUNCTION(MaybeObject*, Runtime_PrepareStep) { |
HandleScope scope(isolate); |
- ASSERT(args.length() == 3); |
+ ASSERT(args.length() == 4); |
// Check arguments. |
Object* check; |
{ MaybeObject* maybe_check = Runtime_CheckExecutionState( |
@@ -12561,6 +12561,15 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_PrepareStep) { |
return isolate->Throw(isolate->heap()->illegal_argument_string()); |
} |
+ CONVERT_NUMBER_CHECKED(int, wrapped_frame_id, Int32, args[3]); |
+ |
+ StackFrame::Id frame_id; |
+ if (wrapped_frame_id == 0) { |
+ frame_id = StackFrame::NO_ID; |
+ } else { |
+ frame_id = UnwrapFrameId(wrapped_frame_id); |
+ } |
+ |
// Get the step action and check validity. |
StepAction step_action = static_cast<StepAction>(NumberToInt32(args[1])); |
if (step_action != StepIn && |
@@ -12571,6 +12580,11 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_PrepareStep) { |
return isolate->Throw(isolate->heap()->illegal_argument_string()); |
} |
+ if (frame_id != 0 && step_action != StepNext && step_action != StepMin && |
Yang
2013/09/05 15:19:54
probably better to compare frame_id to StackFrame:
Peter.Rybin
2013/09/05 16:58:21
Done.
|
+ step_action != StepOut) { |
+ return isolate->ThrowIllegalOperation(); |
+ } |
+ |
// Get the number of steps. |
int step_count = NumberToInt32(args[2]); |
if (step_count < 1) { |
@@ -12582,7 +12596,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_PrepareStep) { |
// Prepare step. |
isolate->debug()->PrepareStep(static_cast<StepAction>(step_action), |
- step_count); |
+ step_count, frame_id); |
Yang
2013/09/05 15:19:54
put frame_id on a new line or all arguments on the
Peter.Rybin
2013/09/05 16:58:21
Done.
|
return isolate->heap()->undefined_value(); |
} |