Commit 84f8e1af authored by yurys's avatar yurys Committed by Commit bot

Remove RestartFrame from live edit API

There is already non-throwing version FrameMirror.restart and RestartFrame in the livedit-debugger.js just adds a throwing wrapper around it.

Also NEEDS_STEP_IN_PROPERTY_NAME was removed, the client code can decide based on the stack_modified field if "step in" is required.

Chromium side was fixed in https://codereview.chromium.org/1249013002/

BUG=None
LOG=N

Review URL: https://codereview.chromium.org/1247363002

Cr-Commit-Position: refs/heads/master@{#29797}
parent a5f5f580
...@@ -27,8 +27,6 @@ Debug.LiveEdit = new function() { ...@@ -27,8 +27,6 @@ Debug.LiveEdit = new function() {
// Forward declaration for minifier. // Forward declaration for minifier.
var FunctionStatus; var FunctionStatus;
var NEEDS_STEP_IN_PROPERTY_NAME = "stack_update_needs_step_in";
// Applies the change to the script. // Applies the change to the script.
// The change is in form of list of chunks encoded in a single array as // The change is in form of list of chunks encoded in a single array as
// a series of triplets (pos1_start, pos1_end, pos2_end) // a series of triplets (pos1_start, pos1_end, pos2_end)
...@@ -149,12 +147,9 @@ Debug.LiveEdit = new function() { ...@@ -149,12 +147,9 @@ Debug.LiveEdit = new function() {
var dropped_functions_number = var dropped_functions_number =
CheckStackActivations(replaced_function_infos, change_log); CheckStackActivations(replaced_function_infos, change_log);
preview_description.stack_modified = dropped_functions_number != 0;
// Our current implementation requires client to manually issue "step in" // Our current implementation requires client to manually issue "step in"
// command for correct stack state. // command for correct stack state if the stack was modified.
preview_description[NEEDS_STEP_IN_PROPERTY_NAME] = preview_description.stack_modified = dropped_functions_number != 0;
preview_description.stack_modified;
// Start with breakpoints. Convert their line/column positions and // Start with breakpoints. Convert their line/column positions and
// temporary remove. // temporary remove.
...@@ -1103,19 +1098,6 @@ Debug.LiveEdit = new function() { ...@@ -1103,19 +1098,6 @@ Debug.LiveEdit = new function() {
return ProcessOldNode(old_code_tree); return ProcessOldNode(old_code_tree);
} }
// Restarts call frame and returns value similar to what LiveEdit returns.
function RestartFrame(frame_mirror) {
var result = frame_mirror.restart();
if (IS_STRING(result)) {
throw new Failure("Failed to restart frame: " + result);
}
var result = {};
result[NEEDS_STEP_IN_PROPERTY_NAME] = true;
return result;
}
// Function is public.
this.RestartFrame = RestartFrame;
// Functions are public for tests. // Functions are public for tests.
this.TestApi = { this.TestApi = {
PosTranslator: PosTranslator, PosTranslator: PosTranslator,
......
...@@ -97,8 +97,9 @@ function TestCase(test_scenario, expected_output) { ...@@ -97,8 +97,9 @@ function TestCase(test_scenario, expected_output) {
return; return;
} }
var frame = FindCallFrame(exec_state, change_code); var frame = FindCallFrame(exec_state, change_code);
// Throws if fails. var error = frame.restart();
Debug.LiveEdit.RestartFrame(frame); if (typeof error === 'string')
throw new Error(error);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment