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

Unified Diff: src/runtime/runtime-classes.cc

Issue 867153003: new classes: special construct stub for derived classs and TDZ for `this`. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: CHECK_OK fixed Created 5 years, 11 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 | « src/preparser.cc ('k') | src/scopes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-classes.cc
diff --git a/src/runtime/runtime-classes.cc b/src/runtime/runtime-classes.cc
index 00567d432330e0e329e1ffd6b15b0c690f7c103d..846fd1aebdc40953ca52b0f205ab8a4010d6ef8f 100644
--- a/src/runtime/runtime-classes.cc
+++ b/src/runtime/runtime-classes.cc
@@ -107,6 +107,13 @@ RUNTIME_FUNCTION(Runtime_DefineClass) {
: isolate->factory()->empty_string();
constructor->shared()->set_name(*name_string);
+ if (FLAG_experimental_classes) {
+ if (!super_class->IsTheHole() && !super_class->IsNull()) {
+ Handle<Code> stub(isolate->builtins()->JSConstructStubForDerived());
+ constructor->shared()->set_construct_stub(*stub);
+ }
+ }
+
JSFunction::SetPrototype(constructor, prototype);
PropertyAttributes attribs =
static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
« no previous file with comments | « src/preparser.cc ('k') | src/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698