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

Unified Diff: src/objects.cc

Issue 1526583002: Revert of [debugger] correctly find source position of implicit return statement. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 | « no previous file | test/mjsunit/debug-sourceinfo.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 3dedb122c75e8c391bdff8eaf24c1a96cdf18ef6..67ccd31014249127b5aede7c3cc6be3cdfc7af5e 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -11352,13 +11352,11 @@
if (cache->IsLineTerminatorSequence(current, next)) line_ends->Add(i);
}
- if (include_ending_line) {
- // Include one character beyond the end of script. The rewriter uses that
- // position for the implicit return statement.
+ if (src_len > 0 && cache->IsLineTerminatorSequence(src[src_len - 1], 0)) {
+ line_ends->Add(src_len - 1);
+ } else if (include_ending_line) {
+ // Even if the last line misses a line end, it is counted.
line_ends->Add(src_len);
- } else if (src_len > 0 &&
- cache->IsLineTerminatorSequence(src[src_len - 1], 0)) {
- line_ends->Add(src_len - 1);
}
}
« no previous file with comments | « no previous file | test/mjsunit/debug-sourceinfo.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698