Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 15909984b9f247921f4f06399b78e3f8c573cc1c..8d7244b6a91511a6c511f9bd956de99bd99a8d1f 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -12115,6 +12115,13 @@ MaybeHandle<Object> JSObject::SetPrototype(Handle<JSObject> object, |
real_receiver = |
Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter)); |
iter.Advance(); |
+ if (!real_receiver->map()->is_extensible()) { |
+ Handle<Object> args[] = {object}; |
+ THROW_NEW_ERROR(isolate, |
+ NewTypeError("non_extensible_proto", |
+ HandleVector(args, arraysize(args))), |
+ Object); |
+ } |
} |
} |