Index: src/runtime/runtime-object.cc |
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc |
index d00ce5276d6ae9fcce0524c278ad8a4652499c3a..b128190fb546a1c1b1a03d4ed9e6167c691ad11d 100644 |
--- a/src/runtime/runtime-object.cc |
+++ b/src/runtime/runtime-object.cc |
@@ -1056,9 +1056,8 @@ static Object* Runtime_NewObjectHelper(Isolate* isolate, |
Handle<JSFunction>::cast(original_constructor); |
- // If function should not have prototype, construction is not allowed. In this |
- // case generated code bailouts here, since function has no initial_map. |
- if (!function->should_have_prototype() && !function->shared()->bound()) { |
+ // Check that function is a constructor. |
+ if (!function->IsConstructor()) { |
THROW_NEW_ERROR_RETURN_FAILURE( |
isolate, NewTypeError(MessageTemplate::kNotConstructor, constructor)); |
} |