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

Unified Diff: src/full-codegen/full-codegen.cc

Issue 1423673003: Debugger: correctly break in default constructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | « no previous file | test/mjsunit/es6/debug-break-default-constructor.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/full-codegen.cc
diff --git a/src/full-codegen/full-codegen.cc b/src/full-codegen/full-codegen.cc
index 008be18e363ecb52a8e36716f25c62c9484543a9..1d8c8b37b96879b5f8a0ef7542e70602a7bd62d6 100644
--- a/src/full-codegen/full-codegen.cc
+++ b/src/full-codegen/full-codegen.cc
@@ -560,7 +560,10 @@ void FullCodeGenerator::SetFunctionPosition(FunctionLiteral* fun) {
void FullCodeGenerator::SetReturnPosition(FunctionLiteral* fun) {
- RecordStatementPosition(masm_, fun->end_position() - 1);
+ // For default constructors, start position equals end position, and there
+ // is no source code besides the class literal.
+ int pos = std::max(fun->start_position(), fun->end_position() - 1);
+ RecordStatementPosition(masm_, pos);
if (info_->is_debug()) {
// Always emit a debug break slot before a return.
DebugCodegen::GenerateSlot(masm_, RelocInfo::DEBUG_BREAK_SLOT_AT_RETURN);
« no previous file with comments | « no previous file | test/mjsunit/es6/debug-break-default-constructor.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698