| Index: src/objects.cc
|
| diff --git a/src/objects.cc b/src/objects.cc
|
| index ecb5bf1b5164265ae48d7f4be04d01181a7c8c65..e2c49772aed8154f48bed6e4c22dedb520816dff 100644
|
| --- a/src/objects.cc
|
| +++ b/src/objects.cc
|
| @@ -12606,6 +12606,13 @@ MaybeHandle<Object> JSObject::SetPrototype(Handle<JSObject> object,
|
| #endif
|
|
|
| Isolate* isolate = object->GetIsolate();
|
| + // Strong objects may not have their prototype set via __proto__ or
|
| + // setPrototypeOf.
|
| + if (from_javascript && object->map()->is_strong()) {
|
| + THROW_NEW_ERROR(isolate,
|
| + NewTypeError(MessageTemplate::kStrongSetProto, object),
|
| + Object);
|
| + }
|
| Heap* heap = isolate->heap();
|
| // Silently ignore the change if value is not a JSObject or null.
|
| // SpiderMonkey behaves this way.
|
|
|