Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Unified Diff: test/mjsunit/debug-liveedit-1.js

Issue 546125: A brutal approach to V8 script liveedit (Closed)
Patch Set: merge Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime.cc ('k') | test/mjsunit/debug-liveedit-2.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/debug-liveedit-1.js
diff --git a/test/mjsunit/debug-liveedit-1.js b/test/mjsunit/debug-liveedit-1.js
new file mode 100644
index 0000000000000000000000000000000000000000..8ca01c0d551d309356427be191ebc70cf10d5dad
--- /dev/null
+++ b/test/mjsunit/debug-liveedit-1.js
@@ -0,0 +1,20 @@
+// Flags: --expose-debug-as debug
+// Get the Debug object exposed from the debug context global object.
+
+Debug = debug.Debug
+
+eval("var something1 = 25; "
+ + " function ChooseAnimal() { return 'Cat'; } "
+ + " ChooseAnimal.Helper = function() { return 'Help!'; }");
+
+assertEquals("Cat", ChooseAnimal());
+
+var script = Debug.findScript(ChooseAnimal);
+
+var orig_animal = "Cat";
+var patch_pos = script.source.indexOf(orig_animal);
+var new_animal_patch = "Cap' + 'y' + 'bara";
+
+Debug.change_script_live(script, patch_pos, orig_animal.length, new_animal_patch);
+
+assertEquals("Capybara", ChooseAnimal());
« no previous file with comments | « src/runtime.cc ('k') | test/mjsunit/debug-liveedit-2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698