Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index 9e44b586bd36e48807fb6a989f264d11681f0edd..56558e0ab5dfb33400523f2a7566da72481ab90b 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -12484,7 +12484,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( |
@@ -12495,6 +12495,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 && |
@@ -12505,6 +12514,11 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_PrepareStep) { |
return isolate->Throw(isolate->heap()->illegal_argument_string()); |
} |
+ if (frame_id != StackFrame::NO_ID && step_action != StepNext && |
+ step_action != StepMin && step_action != StepOut) { |
+ return isolate->ThrowIllegalOperation(); |
+ } |
+ |
// Get the number of steps. |
int step_count = NumberToInt32(args[2]); |
if (step_count < 1) { |
@@ -12516,7 +12530,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_PrepareStep) { |
// Prepare step. |
isolate->debug()->PrepareStep(static_cast<StepAction>(step_action), |
- step_count); |
+ step_count, |
+ frame_id); |
return isolate->heap()->undefined_value(); |
} |