summaryrefslogtreecommitdiff
path: root/deps/v8/test/debugger/debug/debug-liveedit-2.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/debugger/debug/debug-liveedit-2.js')
-rw-r--r--deps/v8/test/debugger/debug/debug-liveedit-2.js14
1 files changed, 3 insertions, 11 deletions
diff --git a/deps/v8/test/debugger/debug/debug-liveedit-2.js b/deps/v8/test/debugger/debug/debug-liveedit-2.js
index 408ee5a08b..f52ec268ec 100644
--- a/deps/v8/test/debugger/debug/debug-liveedit-2.js
+++ b/deps/v8/test/debugger/debug/debug-liveedit-2.js
@@ -25,8 +25,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --noalways-opt
-
+// Flags: --noalways-opt --allow-natives-syntax
Debug = debug.Debug
@@ -43,19 +42,12 @@ var old_closure = ChooseAnimal(19);
assertEquals("Cat", old_closure());
-var script = Debug.findScript(ChooseAnimal);
-
-var orig_animal = "'Cat'";
-var patch_pos = script.source.indexOf(orig_animal);
-var new_animal_patch = "'Capybara' + p";
-
// We patch innermost function "Chooser".
// However, this does not actually patch existing "Chooser" instances,
// because old value of parameter "p" was not saved.
// Instead it patches ChooseAnimal.
-var change_log = new Array();
-Debug.LiveEdit.TestApi.ApplySingleChunkPatch(script, patch_pos, orig_animal.length, new_animal_patch, change_log);
-print("Change log: " + JSON.stringify(change_log) + "\n");
+%LiveEditPatchScript(
+ ChooseAnimal, Debug.scriptSource(ChooseAnimal).replace("'Cat'", "'Capybara' + p"));
var new_closure = ChooseAnimal(19);
// New instance of closure is patched.