Commit 0e9149c5 authored by peter.rybin@gmail.com's avatar peter.rybin@gmail.com

Make a namespace for LiveEdit

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4419 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent a713b274
...@@ -1970,7 +1970,7 @@ DebugCommandProcessor.prototype.profileRequest_ = function(request, response) { ...@@ -1970,7 +1970,7 @@ DebugCommandProcessor.prototype.profileRequest_ = function(request, response) {
DebugCommandProcessor.prototype.changeLiveRequest_ = function(request, response) { DebugCommandProcessor.prototype.changeLiveRequest_ = function(request, response) {
if (!Debug.LiveEditChangeScript) { if (!Debug.LiveEdit) {
return response.failed('LiveEdit feature is not supported'); return response.failed('LiveEdit feature is not supported');
} }
if (!request.arguments) { if (!request.arguments) {
...@@ -2010,7 +2010,7 @@ DebugCommandProcessor.prototype.changeLiveRequest_ = function(request, response) ...@@ -2010,7 +2010,7 @@ DebugCommandProcessor.prototype.changeLiveRequest_ = function(request, response)
return; return;
} }
invocation = function() { invocation = function() {
return Debug.LiveEditChangeScript(the_script, change_pos, change_len, return Debug.LiveEdit.ApplyPatch(the_script, change_pos, change_len,
new_string, change_log); new_string, change_log);
} }
} }
...@@ -2018,7 +2018,7 @@ DebugCommandProcessor.prototype.changeLiveRequest_ = function(request, response) ...@@ -2018,7 +2018,7 @@ DebugCommandProcessor.prototype.changeLiveRequest_ = function(request, response)
try { try {
invocation(); invocation();
} catch (e) { } catch (e) {
if (e instanceof Debug.LiveEditChangeScript.Failure) { if (e instanceof Debug.LiveEdit.Failure) {
// Let's treat it as a "success" so that body with change_log will be // Let's treat it as a "success" so that body with change_log will be
// sent back. "change_log" will have "failure" field set. // sent back. "change_log" will have "failure" field set.
change_log.push( { failure: true, message: e.toString() } ); change_log.push( { failure: true, message: e.toString() } );
......
This diff is collapsed.
...@@ -43,6 +43,6 @@ var patch_pos = script.source.indexOf(orig_animal); ...@@ -43,6 +43,6 @@ var patch_pos = script.source.indexOf(orig_animal);
var new_animal_patch = "Cap' + 'y' + 'bara"; var new_animal_patch = "Cap' + 'y' + 'bara";
var change_log = new Array(); var change_log = new Array();
Debug.LiveEditChangeScript(script, patch_pos, orig_animal.length, new_animal_patch, change_log); Debug.LiveEdit.ApplyPatch(script, patch_pos, orig_animal.length, new_animal_patch, change_log);
assertEquals("Capybara", ChooseAnimal()); assertEquals("Capybara", ChooseAnimal());
...@@ -58,7 +58,7 @@ var new_animal_patch = "'Capybara' + p"; ...@@ -58,7 +58,7 @@ var new_animal_patch = "'Capybara' + p";
// because old value of parameter "p" was not saved. // because old value of parameter "p" was not saved.
// Instead it patches ChooseAnimal. // Instead it patches ChooseAnimal.
var change_log = new Array(); var change_log = new Array();
Debug.LiveEditChangeScript(script, patch_pos, orig_animal.length, new_animal_patch, change_log); Debug.LiveEdit.ApplyPatch(script, patch_pos, orig_animal.length, new_animal_patch, change_log);
print("Change log: " + JSON.stringify(change_log) + "\n"); print("Change log: " + JSON.stringify(change_log) + "\n");
var new_closure = ChooseAnimal(19); var new_closure = ChooseAnimal(19);
......
...@@ -60,7 +60,7 @@ function TestBase(name) { ...@@ -60,7 +60,7 @@ function TestBase(name) {
// Runs in debugger context. // Runs in debugger context.
var change_log = new Array(); var change_log = new Array();
try { try {
Debug.LiveEditChangeScript(script, patch_pos, orig_animal.length, new_animal_patch, change_log); Debug.LiveEdit.ApplyPatch(script, patch_pos, orig_animal.length, new_animal_patch, change_log);
} finally { } finally {
print("Change log: " + JSON.stringify(change_log) + "\n"); print("Change log: " + JSON.stringify(change_log) + "\n");
} }
...@@ -76,7 +76,7 @@ function WrapInCatcher(f, holder) { ...@@ -76,7 +76,7 @@ function WrapInCatcher(f, holder) {
try { try {
f(); f();
} catch (e) { } catch (e) {
if (e instanceof Debug.LiveEditChangeScript.Failure) { if (e instanceof Debug.LiveEdit.Failure) {
holder[0] = e; holder[0] = e;
} else { } else {
throw e; throw e;
......
...@@ -59,7 +59,7 @@ var new_body_patch = "{return 'Capybara';" + ...@@ -59,7 +59,7 @@ var new_body_patch = "{return 'Capybara';" +
var change_log = new Array(); var change_log = new Array();
function Changer() { function Changer() {
Debug.LiveEditChangeScript(script, patch_pos, orig_body.length, new_body_patch, change_log); Debug.LiveEdit.ApplyPatch(script, patch_pos, orig_body.length, new_body_patch, change_log);
print("Change log: " + JSON.stringify(change_log) + "\n"); print("Change log: " + JSON.stringify(change_log) + "\n");
} }
......
...@@ -62,7 +62,7 @@ function ReadMarkerPositions(func) { ...@@ -62,7 +62,7 @@ function ReadMarkerPositions(func) {
function ReadPCMap(func, positions) { function ReadPCMap(func, positions) {
var res = new Array(); var res = new Array();
for (var i = 0; i < positions.length; i++) { for (var i = 0; i < positions.length; i++) {
res.push(Debug.LiveEditChangeScript.GetPcFromSourcePos(func, positions[i])); res.push(Debug.LiveEdit.GetPcFromSourcePos(func, positions[i]));
} }
return res; return res;
} }
...@@ -80,7 +80,7 @@ var patch_pos = script.source.indexOf(orig_animal); ...@@ -80,7 +80,7 @@ var patch_pos = script.source.indexOf(orig_animal);
var new_animal_patch = "'Capybara'"; var new_animal_patch = "'Capybara'";
var change_log = new Array(); var change_log = new Array();
Debug.LiveEditChangeScript(script, patch_pos, orig_animal.length, new_animal_patch, change_log); Debug.LiveEdit.ApplyPatch(script, patch_pos, orig_animal.length, new_animal_patch, change_log);
print("Change log: " + JSON.stringify(change_log) + "\n"); print("Change log: " + JSON.stringify(change_log) + "\n");
var res = ChooseAnimal(); var res = 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