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

Unified Diff: src/objects.cc

Issue 1521953003: [debugger] correctly find source position of implicit return statement. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: reland 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 67ccd31014249127b5aede7c3cc6be3cdfc7af5e..cebb4490c8c26af58875a407677de539ca695b8a 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -11354,8 +11354,10 @@ static void CalculateLineEndsImpl(Isolate* isolate,
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.
+ }
+ if (include_ending_line) {
+ // Include one character beyond the end of script. The rewriter uses that
+ // position for the implicit return statement.
line_ends->Add(src_len);
}
}
« 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