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

Unified Diff: test/mjsunit/debug-sourceinfo.js

Issue 1137683003: Only record one in n line endings to save space. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix false detection of exotic newlines Created 5 years, 6 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 | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/debug-sourceinfo.js
diff --git a/test/mjsunit/debug-sourceinfo.js b/test/mjsunit/debug-sourceinfo.js
index 1dbe1b7a0a47643b19424472535f71dba13d49cb..9c0344965a069a62c2b6e940f6a2d34f1e1c0b04 100644
--- a/test/mjsunit/debug-sourceinfo.js
+++ b/test/mjsunit/debug-sourceinfo.js
@@ -63,11 +63,11 @@ var comment_lines = 28;
// This is the last position in the entire file (note: this equals
// file size of <debug-sourceinfo.js> - 1, since starting at 0).
-var last_position = 11337;
+var last_position = 11591;
// This is the last line of entire file (note: starting at 0).
-var last_line = 265;
-// This is the last column of last line (note: starting at 0 and +1, due
-// to trailing <LF>).
+var last_line = 268;
+// This is the column of the last character (note: starting at 0) due to
+// final line having a trailing newline that is conceptually part of that line.
var last_column = 1;
// This magic number is the length or the first line comment (actually number
@@ -250,7 +250,10 @@ assertEquals(158 + start_d, Debug.findFunctionSourceLocation(d, 17, 0).position)
// Make sure invalid inputs work properly.
assertEquals(0, script.locationFromPosition(-1).line);
-assertEquals(null, script.locationFromPosition(last_position + 1));
+// We might expect last_position + 1 to be the first illegal position, but we
+// sometimes generate character positions that are one past the last character.
+// See Rewriter::Rewrite for details.
+assertEquals(null, script.locationFromPosition(last_position + 2));
// Test last position.
assertEquals(last_position, script.locationFromPosition(last_position).position);
« no previous file with comments | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698