| Index: src/objects.cc
|
| diff --git a/src/objects.cc b/src/objects.cc
|
| index 6181ed63f901192dff68bc1861120359368d2af8..411dcf74b0d31643085563b80754757249b889ac 100644
|
| --- a/src/objects.cc
|
| +++ b/src/objects.cc
|
| @@ -4374,15 +4374,18 @@ Maybe<bool> Object::SetPropertyInternal(LookupIterator* it,
|
| value, it->GetReceiver(), language_mode);
|
|
|
| case LookupIterator::INTERCEPTOR: {
|
| - Handle<Map> store_target_map =
|
| - handle(it->GetStoreTarget()->map(), it->isolate());
|
| + Handle<Map> store_target_map;
|
| + if (it->GetReceiver()->IsJSObject()) {
|
| + store_target_map = handle(it->GetStoreTarget()->map(), it->isolate());
|
| + }
|
| if (it->HolderIsReceiverOrHiddenPrototype()) {
|
| Maybe<bool> result =
|
| JSObject::SetPropertyWithInterceptor(it, should_throw, value);
|
| if (result.IsNothing() || result.FromJust()) return result;
|
| // Interceptor modified the store target but failed to set the
|
| // property.
|
| - Utils::ApiCheck(*store_target_map == it->GetStoreTarget()->map(),
|
| + Utils::ApiCheck(store_target_map.is_null() ||
|
| + *store_target_map == it->GetStoreTarget()->map(),
|
| it->IsElement() ? "v8::IndexedPropertySetterCallback"
|
| : "v8::NamedPropertySetterCallback",
|
| "Interceptor silently changed store target.");
|
| @@ -4395,7 +4398,8 @@ Maybe<bool> Object::SetPropertyInternal(LookupIterator* it,
|
| }
|
| // Interceptor modified the store target but failed to set the
|
| // property.
|
| - Utils::ApiCheck(*store_target_map == it->GetStoreTarget()->map(),
|
| + Utils::ApiCheck(store_target_map.is_null() ||
|
| + *store_target_map == it->GetStoreTarget()->map(),
|
| it->IsElement() ? "v8::IndexedPropertySetterCallback"
|
| : "v8::NamedPropertySetterCallback",
|
| "Interceptor silently changed store target.");
|
|
|