| Index: src/objects.cc
|
| diff --git a/src/objects.cc b/src/objects.cc
|
| index 6cfd9468da00872eece5d92e6320742c153ce63e..a6e0dcd4c1b858ea1106cf7663b57efd0f590eb1 100644
|
| --- a/src/objects.cc
|
| +++ b/src/objects.cc
|
| @@ -1707,8 +1707,9 @@ void JSObject::LookupCallbackSetterInPrototypes(String* name,
|
| }
|
|
|
|
|
| -bool JSObject::SetElementWithCallbackSetterInPrototypes(uint32_t index,
|
| - Object* value) {
|
| +MaybeObject* JSObject::SetElementWithCallbackSetterInPrototypes(uint32_t index,
|
| + Object* value,
|
| + bool* found) {
|
| for (Object* pt = GetPrototype();
|
| pt != Heap::null_value();
|
| pt = pt->GetPrototype()) {
|
| @@ -1718,15 +1719,16 @@ bool JSObject::SetElementWithCallbackSetterInPrototypes(uint32_t index,
|
| NumberDictionary* dictionary = JSObject::cast(pt)->element_dictionary();
|
| int entry = dictionary->FindEntry(index);
|
| if (entry != NumberDictionary::kNotFound) {
|
| - Object* element = dictionary->ValueAt(entry);
|
| PropertyDetails details = dictionary->DetailsAt(entry);
|
| if (details.type() == CALLBACKS) {
|
| - SetElementWithCallback(element, index, value, JSObject::cast(pt));
|
| - return true;
|
| + *found = true;
|
| + return SetElementWithCallback(
|
| + dictionary->ValueAt(entry), index, value, JSObject::cast(pt));
|
| }
|
| }
|
| }
|
| - return false;
|
| + *found = false;
|
| + return Heap::the_hole_value();
|
| }
|
|
|
|
|
| @@ -6969,9 +6971,11 @@ MaybeObject* JSObject::SetFastElement(uint32_t index,
|
| uint32_t elms_length = static_cast<uint32_t>(elms->length());
|
|
|
| if (check_prototype &&
|
| - (index >= elms_length || elms->get(index)->IsTheHole()) &&
|
| - SetElementWithCallbackSetterInPrototypes(index, value)) {
|
| - return value;
|
| + (index >= elms_length || elms->get(index)->IsTheHole())) {
|
| + bool found;
|
| + MaybeObject* result =
|
| + SetElementWithCallbackSetterInPrototypes(index, value, &found);
|
| + if (found) return result;
|
| }
|
|
|
|
|
| @@ -7103,9 +7107,11 @@ MaybeObject* JSObject::SetElementWithoutInterceptor(uint32_t index,
|
| }
|
| } else {
|
| // Index not already used. Look for an accessor in the prototype chain.
|
| - if (check_prototype &&
|
| - SetElementWithCallbackSetterInPrototypes(index, value)) {
|
| - return value;
|
| + if (check_prototype) {
|
| + bool found;
|
| + MaybeObject* result =
|
| + SetElementWithCallbackSetterInPrototypes(index, value, &found);
|
| + if (found) return result;
|
| }
|
| // When we set the is_extensible flag to false we always force
|
| // the element into dictionary mode (and force them to stay there).
|
|
|