Index: src/runtime/runtime-classes.cc |
diff --git a/src/runtime/runtime-classes.cc b/src/runtime/runtime-classes.cc |
index 323604ffdec47047d31e14cd4600fa9e0f78e068..fb1b34f5ba4bb5970497577118786ea2b9986802 100644 |
--- a/src/runtime/runtime-classes.cc |
+++ b/src/runtime/runtime-classes.cc |
@@ -403,7 +403,11 @@ RUNTIME_FUNCTION(Runtime_GetSuperConstructor) { |
SealHandleScope shs(isolate); |
DCHECK_EQ(1, args.length()); |
CONVERT_ARG_CHECKED(JSFunction, active_function, 0); |
- return active_function->map()->prototype(); |
+ Object* prototype = active_function->map()->prototype(); |
+ if (!prototype->IsConstructor()) { |
+ return Runtime_ThrowConstructedNonConstructable(1, &prototype, isolate); |
Benedikt Meurer
2016/11/23 04:51:00
Please don't call other runtime functions this way
|
+ } |
+ return prototype; |
} |
} // namespace internal |