| Index: src/runtime/runtime-classes.cc
|
| diff --git a/src/runtime/runtime-classes.cc b/src/runtime/runtime-classes.cc
|
| index 50c2ccae9bc3120cc4b9f87a5f88e38bdad0e799..5219a6882b2ea72c61f4ff9f53dba107f74a8cdd 100644
|
| --- a/src/runtime/runtime-classes.cc
|
| +++ b/src/runtime/runtime-classes.cc
|
| @@ -105,8 +105,9 @@ static MaybeHandle<Object> DefineClass(Isolate* isolate, Handle<Object> name,
|
| } else {
|
| if (super_class->IsNull()) {
|
| prototype_parent = isolate->factory()->null_value();
|
| - } else if (super_class->IsJSFunction()) { // TODO(bmeurer): IsConstructor.
|
| - if (Handle<JSFunction>::cast(super_class)->shared()->is_generator()) {
|
| + } else if (super_class->IsConstructor()) {
|
| + if (super_class->IsJSFunction() &&
|
| + Handle<JSFunction>::cast(super_class)->shared()->is_generator()) {
|
| THROW_NEW_ERROR(
|
| isolate,
|
| NewTypeError(MessageTemplate::kExtendsValueGenerator, super_class),
|
|
|