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

Side by Side Diff: test/mjsunit/debug-liveedit-patch-positions.js

Issue 1697016: LiveEdit: clean JS sources a bit (Closed)
Patch Set: tab Created 10 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 var markerPositionsBefore = ReadMarkerPositions(ChooseAnimal); 73 var markerPositionsBefore = ReadMarkerPositions(ChooseAnimal);
74 var pcArrayBefore = ReadPCMap(ChooseAnimal, markerPositionsBefore); 74 var pcArrayBefore = ReadPCMap(ChooseAnimal, markerPositionsBefore);
75 75
76 var script = Debug.findScript(ChooseAnimal); 76 var script = Debug.findScript(ChooseAnimal);
77 77
78 var orig_animal = "'Cat'"; 78 var orig_animal = "'Cat'";
79 var patch_pos = script.source.indexOf(orig_animal); 79 var patch_pos = script.source.indexOf(orig_animal);
80 var new_animal_patch = "'Capybara'"; 80 var new_animal_patch = "'Capybara'";
81 81
82 var change_log = new Array(); 82 var change_log = new Array();
83 Debug.LiveEdit.ApplyPatch(script, patch_pos, orig_animal.length, new_animal_patc h, change_log); 83 Debug.LiveEdit.TestApi.ApplySingleChunkPatch(script, patch_pos, orig_animal.leng th, new_animal_patch, change_log);
84 print("Change log: " + JSON.stringify(change_log) + "\n"); 84 print("Change log: " + JSON.stringify(change_log) + "\n");
85 85
86 var res = ChooseAnimal(); 86 var res = ChooseAnimal();
87 assertEquals("Capybara15", res); 87 assertEquals("Capybara15", res);
88 88
89 var markerPositionsAfter = ReadMarkerPositions(ChooseAnimal); 89 var markerPositionsAfter = ReadMarkerPositions(ChooseAnimal);
90 var pcArrayAfter = ReadPCMap(ChooseAnimal, markerPositionsAfter); 90 var pcArrayAfter = ReadPCMap(ChooseAnimal, markerPositionsAfter);
91 91
92 assertArrayEquals(pcArrayBefore, pcArrayAfter); 92 assertArrayEquals(pcArrayBefore, pcArrayAfter);
93 93
OLDNEW
« no previous file with comments | « test/mjsunit/debug-liveedit-check-stack.js ('k') | test/mjsunit/debug-liveedit-patch-positions-replace.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698