Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 89bc3c91c941c765ff346f068f93ce38a9044970..c3399992edc7e64cb298c4fe5b83240ae93cc211 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -4493,8 +4493,7 @@ Maybe<bool> Object::AddDataProperty(LookupIterator* it, Handle<Object> value, |
Isolate* isolate = it->isolate(); |
- if (!receiver->map()->is_extensible() && |
- (it->IsElement() || !isolate->IsInternallyUsedPropertyName(it->name()))) { |
+ if (it->ExtendingNonExtensible(receiver)) { |
RETURN_FAILURE( |
isolate, should_throw, |
NewTypeError(MessageTemplate::kObjectNotExtensible, it->GetName())); |
@@ -4527,9 +4526,10 @@ Maybe<bool> Object::AddDataProperty(LookupIterator* it, Handle<Object> value, |
} else { |
// Migrate to the most up-to-date map that will be able to store |value| |
// under it->name() with |attributes|. |
- it->PrepareTransitionToDataProperty(value, attributes, store_mode); |
+ it->PrepareTransitionToDataProperty(receiver, value, attributes, |
+ store_mode); |
DCHECK_EQ(LookupIterator::TRANSITION, it->state()); |
- it->ApplyTransitionToDataProperty(); |
+ it->ApplyTransitionToDataProperty(receiver); |
// TODO(verwaest): Encapsulate dictionary handling better. |
if (receiver->map()->is_dictionary_map()) { |
@@ -9942,13 +9942,11 @@ Handle<Map> Map::PrepareForDataProperty(Handle<Map> map, int descriptor, |
// Migrate to the newest map before storing the property. |
map = Update(map); |
- Handle<DescriptorArray> descriptors(map->instance_descriptors()); |
- |
- if (descriptors->CanHoldValue(descriptor, *value)) return map; |
+ if (map->instance_descriptors()->CanHoldValue(descriptor, *value)) return map; |
Isolate* isolate = map->GetIsolate(); |
PropertyAttributes attributes = |
- descriptors->GetDetails(descriptor).attributes(); |
+ map->instance_descriptors()->GetDetails(descriptor).attributes(); |
Representation representation = value->OptimalRepresentation(); |
Handle<FieldType> type = value->OptimalType(isolate, representation); |