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

Unified Diff: src/full-codegen.cc

Issue 700523003: Classes: Partial fix for constructor not calling super (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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
Index: src/full-codegen.cc
diff --git a/src/full-codegen.cc b/src/full-codegen.cc
index 58e5e978abf2dd7b73363378ccef7d1d4e9780f6..7adb659315e942b13bfc84fe3b5f2503980b8ff8 100644
--- a/src/full-codegen.cc
+++ b/src/full-codegen.cc
@@ -820,12 +820,16 @@ int FullCodeGenerator::DeclareGlobalsFlags() {
void FullCodeGenerator::SetFunctionPosition(FunctionLiteral* fun) {
- CodeGenerator::RecordPositions(masm_, fun->start_position());
+ if (fun->start_position() != RelocInfo::kNoPosition) {
+ CodeGenerator::RecordPositions(masm_, fun->start_position());
+ }
}
void FullCodeGenerator::SetReturnPosition(FunctionLiteral* fun) {
- CodeGenerator::RecordPositions(masm_, fun->end_position() - 1);
+ if (fun->end_position() != RelocInfo::kNoPosition) {
+ CodeGenerator::RecordPositions(masm_, fun->end_position() - 1);
+ }
}
@@ -1575,11 +1579,7 @@ void FullCodeGenerator::VisitClassLiteral(ClassLiteral* lit) {
__ Push(isolate()->factory()->the_hole_value());
}
- if (lit->constructor() != NULL) {
- VisitForStackValue(lit->constructor());
- } else {
- __ Push(isolate()->factory()->undefined_value());
- }
+ VisitForStackValue(lit->constructor());
__ Push(script());
__ Push(Smi::FromInt(lit->start_position()));

Powered by Google App Engine
This is Rietveld 408576698