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

Unified Diff: test/mjsunit/regress/regress-419663.js

Issue 658723005: Fix break location calculation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/debug.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/debug.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698