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

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

Issue 2504553003: [es6] Perform the IsConstructor test in GetSuperConstructor. (Closed)
Patch Set: Convert GetSuperConstructor to a new interpreter bytecode Created 4 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
« src/interpreter/interpreter.cc ('K') | « src/interpreter/interpreter.cc ('k') | no next file » | 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 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
« src/interpreter/interpreter.cc ('K') | « src/interpreter/interpreter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698