Commit 6563b3a2 authored by peter.rybin@gmail.com's avatar peter.rybin@gmail.com

Describe LiveEdit changes and support preview mode

Review URL: http://codereview.chromium.org/2883020

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5015 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8b818572
......@@ -2070,6 +2070,7 @@ DebugCommandProcessor.prototype.changeLiveRequest_ = function(request, response)
return response.failed('Missing arguments');
}
var script_id = request.arguments.script_id;
var preview_only = !!request.arguments.preview_only;
var scripts = %DebugGetLoadedScripts();
......@@ -2092,18 +2093,9 @@ DebugCommandProcessor.prototype.changeLiveRequest_ = function(request, response)
var new_source = request.arguments.new_source;
try {
Debug.LiveEdit.SetScriptSource(the_script, new_source, change_log);
} catch (e) {
if (e instanceof Debug.LiveEdit.Failure) {
// Let's treat it as a "success" so that body with change_log will be
// sent back. "change_log" will have "failure" field set.
change_log.push( { failure: true, message: e.toString() } );
} else {
throw e;
}
}
response.body = {change_log: change_log};
var result_description = Debug.LiveEdit.SetScriptSource(the_script,
new_source, preview_only, change_log);
response.body = {change_log: change_log, result: result_description};
};
......
This diff is collapsed.
......@@ -57,7 +57,8 @@ var new_source = script.source.replace(function_z_text, "function Intermediate()
print("new source: " + new_source);
var change_log = new Array();
Debug.LiveEdit.SetScriptSource(script, new_source, change_log);
var result = Debug.LiveEdit.SetScriptSource(script, new_source, false, change_log);
print("Result: " + JSON.stringify(result) + "\n");
print("Change log: " + JSON.stringify(change_log) + "\n");
assertEquals(8, z6());
......
......@@ -72,7 +72,8 @@ var new_source = script.source.replace(function_z_text, "");
print("new source: " + new_source);
var change_log = new Array();
Debug.LiveEdit.SetScriptSource(script, new_source, change_log);
var result = Debug.LiveEdit.SetScriptSource(script, new_source, false, change_log);
print("Result: " + JSON.stringify(result) + "\n");
print("Change log: " + JSON.stringify(change_log) + "\n");
var breaks = Debug.scriptBreakPoints();
......
......@@ -57,7 +57,8 @@ var new_source = new_source.replace("17", "18");
print("new source: " + new_source);
var change_log = new Array();
Debug.LiveEdit.SetScriptSource(script, new_source, change_log);
var result = Debug.LiveEdit.SetScriptSource(script, new_source, false, change_log);
print("Result: " + JSON.stringify(result) + "\n");
print("Change log: " + JSON.stringify(change_log) + "\n");
assertEquals("Capybara", ChooseAnimal());
......
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