| Index: src/objects.cc
|
| diff --git a/src/objects.cc b/src/objects.cc
|
| index 2b6f2352ae647b5a2eec0b7461caa3aeab50b8a2..e1931887b864f6e1e8cf0ea722218df8e45cbcee 100644
|
| --- a/src/objects.cc
|
| +++ b/src/objects.cc
|
| @@ -4257,10 +4257,10 @@ void JSObject::LookupCallback(String* name, LookupResult* result) {
|
|
|
|
|
| // Search for a getter or setter in an elements dictionary and update its
|
| -// attributes. Returns either undefined if the element is read-only, or the
|
| -// getter/setter pair (fixed array) if there is an existing one, or the hole
|
| -// value if the element does not exist or is a normal non-getter/setter data
|
| -// element.
|
| +// attributes. Returns either undefined if the element is non-deletable, or
|
| +// the getter/setter pair (fixed array) if there is an existing one, or the
|
| +// hole value if the element does not exist or is a normal non-getter/setter
|
| +// data element.
|
| static Object* UpdateGetterSetterInDictionary(NumberDictionary* dictionary,
|
| uint32_t index,
|
| PropertyAttributes attributes,
|
| @@ -4269,7 +4269,8 @@ static Object* UpdateGetterSetterInDictionary(NumberDictionary* dictionary,
|
| if (entry != NumberDictionary::kNotFound) {
|
| Object* result = dictionary->ValueAt(entry);
|
| PropertyDetails details = dictionary->DetailsAt(entry);
|
| - if (details.IsReadOnly()) return heap->undefined_value();
|
| + // TODO(mstarzinger): We should check for details.IsDontDelete() here once
|
| + // we only call into the runtime once to set both getter and setter.
|
| if (details.type() == CALLBACKS && result->IsFixedArray()) {
|
| if (details.attributes() != attributes) {
|
| dictionary->DetailsAtPut(entry,
|
| @@ -4353,7 +4354,8 @@ MaybeObject* JSObject::DefineGetterSetter(String* name,
|
| LookupResult result(heap->isolate());
|
| LocalLookup(name, &result);
|
| if (result.IsProperty()) {
|
| - if (result.IsReadOnly()) return heap->undefined_value();
|
| + // TODO(mstarzinger): We should check for result.IsDontDelete() here once
|
| + // we only call into the runtime once to set both getter and setter.
|
| if (result.type() == CALLBACKS) {
|
| Object* obj = result.GetCallbackObject();
|
| // Need to preserve old getters/setters.
|
|
|