OLD | NEW |
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 Loading... |
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 |
OLD | NEW |