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

Unified Diff: src/full-codegen.cc

Issue 698073005: Classes: Fix issue with default constructor crash (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix context issue by using EmitNewClosure 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
« no previous file with comments | « src/contexts.h ('k') | src/harmony-classes.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen.cc
diff --git a/src/full-codegen.cc b/src/full-codegen.cc
index 58e5e978abf2dd7b73363378ccef7d1d4e9780f6..2bea70b0edee92d7084199c6bf33fa3dc2cbbdb8 100644
--- a/src/full-codegen.cc
+++ b/src/full-codegen.cc
@@ -1578,7 +1578,12 @@ void FullCodeGenerator::VisitClassLiteral(ClassLiteral* lit) {
if (lit->constructor() != NULL) {
VisitForStackValue(lit->constructor());
} else {
- __ Push(isolate()->factory()->undefined_value());
+ Handle<JSFunction> default_constructor =
+ lit->extends() == NULL ? isolate()->default_constructor_no_super()
+ : isolate()->default_constructor();
+ Handle<SharedFunctionInfo> shared(default_constructor->shared());
+ EmitNewClosure(shared, false);
+ __ Push(result_register());
}
__ Push(script());
« no previous file with comments | « src/contexts.h ('k') | src/harmony-classes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698