Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 7422aec4e6603ddbbf52a3295a9fea13e8da9b6b..f3cccc078e2aeffd3b0f71ef416c07341ea1dbde 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -3765,12 +3765,19 @@ Maybe<bool> Object::SetSuperProperty(LookupIterator* it, Handle<Object> value, |
should_throw); |
case LookupIterator::DATA: { |
+ DCHECK(it->GetReceiver()->IsJSObject()); |
PropertyDetails details = own_lookup.property_details(); |
- if (details.IsConfigurable() || !details.IsReadOnly()) { |
- return JSObject::DefineOwnPropertyIgnoreAttributes( |
- &own_lookup, value, details.attributes(), should_throw); |
+ if (details.IsReadOnly()) { |
+ return WriteToReadOnlyProperty(&own_lookup, value, should_throw); |
} |
- return WriteToReadOnlyProperty(&own_lookup, value, should_throw); |
+ if (!JSObject::IsExtensible( |
rossberg
2015/11/03 10:55:11
I don't think this check is correct. Extensibility
|
+ Handle<JSObject>::cast(it->GetReceiver()))) { |
+ RETURN_FAILURE(it->isolate(), should_throw, |
+ NewTypeError(MessageTemplate::kObjectNotExtensible, |
+ it->GetName())); |
+ } |
+ return JSObject::DefineOwnPropertyIgnoreAttributes( |
+ &own_lookup, value, details.attributes(), should_throw); |
} |
case LookupIterator::ACCESSOR: { |