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); |
} |
} |