| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 Debug.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId, script.id, 1, 1,
"true || false || false"); | 65 Debug.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId, script.id, 1, 1,
"true || false || false"); |
| 66 Debug.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId, script.id, 6, 1,
"true || false || false"); | 66 Debug.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId, script.id, 6, 1,
"true || false || false"); |
| 67 Debug.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId, script.id, 14, 1,
"true || false || false"); | 67 Debug.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId, script.id, 14, 1,
"true || false || false"); |
| 68 | 68 |
| 69 assertEquals(3, Debug.scriptBreakPoints().length); | 69 assertEquals(3, Debug.scriptBreakPoints().length); |
| 70 | 70 |
| 71 var new_source = script.source.replace(function_z_text, ""); | 71 var new_source = script.source.replace(function_z_text, ""); |
| 72 print("new source: " + new_source); | 72 print("new source: " + new_source); |
| 73 | 73 |
| 74 var change_log = new Array(); | 74 var change_log = new Array(); |
| 75 Debug.LiveEdit.SetScriptSource(script, new_source, change_log); | 75 var result = Debug.LiveEdit.SetScriptSource(script, new_source, false, change_lo
g); |
| 76 print("Result: " + JSON.stringify(result) + "\n"); |
| 76 print("Change log: " + JSON.stringify(change_log) + "\n"); | 77 print("Change log: " + JSON.stringify(change_log) + "\n"); |
| 77 | 78 |
| 78 var breaks = Debug.scriptBreakPoints(); | 79 var breaks = Debug.scriptBreakPoints(); |
| 79 | 80 |
| 80 // One breakpoint gets duplicated in a old version of script. | 81 // One breakpoint gets duplicated in a old version of script. |
| 81 assertTrue(breaks.length > 3 + 1); | 82 assertTrue(breaks.length > 3 + 1); |
| 82 | 83 |
| 83 var breakpoints_in_script = 0; | 84 var breakpoints_in_script = 0; |
| 84 var break_position_map = {}; | 85 var break_position_map = {}; |
| 85 for (var i = 0; i < breaks.length; i++) { | 86 for (var i = 0; i < breaks.length; i++) { |
| 86 if (breaks[i].script_id() == script.id) { | 87 if (breaks[i].script_id() == script.id) { |
| 87 break_position_map[breaks[i].line()] = true; | 88 break_position_map[breaks[i].line()] = true; |
| 88 breakpoints_in_script++; | 89 breakpoints_in_script++; |
| 89 } | 90 } |
| 90 } | 91 } |
| 91 | 92 |
| 92 assertEquals(3, breakpoints_in_script); | 93 assertEquals(3, breakpoints_in_script); |
| 93 | 94 |
| 94 // Check 2 breakpoints. The one in deleted function should have been moved somew
here. | 95 // Check 2 breakpoints. The one in deleted function should have been moved somew
here. |
| 95 assertTrue(break_position_map[1]); | 96 assertTrue(break_position_map[1]); |
| 96 assertTrue(break_position_map[11]); | 97 assertTrue(break_position_map[11]); |
| 97 | 98 |
| OLD | NEW |