Index: test/mjsunit/regress/regress-419663.js |
diff --git a/test/mjsunit/regress/regress-419663.js b/test/mjsunit/regress/regress-419663.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2655e2cdd0d39241f1d89312884abef7867a85ea |
--- /dev/null |
+++ b/test/mjsunit/regress/regress-419663.js |
@@ -0,0 +1,37 @@ |
+// Copyright 2012 the V8 project authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// Flags: --expose-debug-as debug |
+ |
+var o = { |
+ f: function(x) { |
+ var a = x + 1; |
+ o = 1; |
+ } |
+} |
+ |
+function sentinel() {} |
+ |
+var Debug = debug.Debug; |
+ |
+Debug.setListener(function() {}); |
+ |
+var script = Debug.findScript(sentinel); |
+ |
+// Used in Debug.setScriptBreakPointById. |
+var p1 = Debug.findScriptSourcePosition(script, 9, 0); |
+var p2 = Debug.setBreakPointByScriptIdAndPosition(script.id, p1).actual_position; |
+var p3 = Debug.setBreakPointByScriptIdAndPosition(script.id, p2).actual_position; |
+ |
+assertEquals(p2, p3); |
+ |
+function assertLocation(p, l, c) { |
+ var location = script.locationFromPosition(p, false); |
+ assertEquals(l, location.line); |
+ assertEquals(c, location.column); |
+} |
+ |
+assertLocation(p1, 9, 0); |
+assertLocation(p2, 9, 4); |
+assertLocation(p3, 9, 4); |