OLD | NEW |
(Empty) | |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Flags: --expose-debug-as debug |
| 6 |
| 7 var o = { |
| 8 f: function(x) { |
| 9 var a = x + 1; |
| 10 o = 1; |
| 11 } |
| 12 } |
| 13 |
| 14 function sentinel() {} |
| 15 |
| 16 var Debug = debug.Debug; |
| 17 |
| 18 Debug.setListener(function() {}); |
| 19 |
| 20 var script = Debug.findScript(sentinel); |
| 21 |
| 22 // Used in Debug.setScriptBreakPointById. |
| 23 var p1 = Debug.findScriptSourcePosition(script, 9, 0); |
| 24 var p2 = Debug.setBreakPointByScriptIdAndPosition(script.id, p1).actual_position
; |
| 25 var p3 = Debug.setBreakPointByScriptIdAndPosition(script.id, p2).actual_position
; |
| 26 |
| 27 assertEquals(p2, p3); |
| 28 |
| 29 function assertLocation(p, l, c) { |
| 30 var location = script.locationFromPosition(p, false); |
| 31 assertEquals(l, location.line); |
| 32 assertEquals(c, location.column); |
| 33 } |
| 34 |
| 35 assertLocation(p1, 9, 0); |
| 36 assertLocation(p2, 9, 4); |
| 37 assertLocation(p3, 9, 4); |
OLD | NEW |