| Index: src/objects.cc
|
| diff --git a/src/objects.cc b/src/objects.cc
|
| index 7259a6c3290254ca2cbbb646f57a0e3940bf21d4..be432f9e7dcaa0028c36d9c49949cc73260a53c4 100644
|
| --- a/src/objects.cc
|
| +++ b/src/objects.cc
|
| @@ -4204,8 +4204,7 @@ MaybeHandle<Object> JSObject::SetOwnPropertyIgnoreAttributes(
|
| PropertyAttributes attributes,
|
| StoreMode mode,
|
| ExtensibilityCheck extensibility_check,
|
| - StoreFromKeyed store_from_keyed,
|
| - ExecutableAccessorInfoHandling handling) {
|
| + StoreFromKeyed store_from_keyed) {
|
| Isolate* isolate = object->GetIsolate();
|
|
|
| // Make sure that the top context does not change when doing callbacks or
|
| @@ -4260,8 +4259,6 @@ MaybeHandle<Object> JSObject::SetOwnPropertyIgnoreAttributes(
|
| old_attributes = lookup.GetAttributes();
|
| }
|
|
|
| - bool executed_set_prototype = false;
|
| -
|
| // Check of IsReadOnly removed from here in clone.
|
| if (lookup.IsTransition()) {
|
| Handle<Object> result;
|
| @@ -4285,11 +4282,9 @@ MaybeHandle<Object> JSObject::SetOwnPropertyIgnoreAttributes(
|
| SetPropertyToFieldWithAttributes(&lookup, name, value, attributes);
|
| }
|
| break;
|
| - case CALLBACKS:
|
| - {
|
| + case CALLBACKS: {
|
| Handle<Object> callback(lookup.GetCallbackObject(), isolate);
|
| - if (callback->IsExecutableAccessorInfo() &&
|
| - handling == DONT_FORCE_FIELD) {
|
| + if (callback->IsExecutableAccessorInfo()) {
|
| Handle<Object> result;
|
| ASSIGN_RETURN_ON_EXCEPTION(
|
| isolate, result,
|
| @@ -4301,31 +4296,29 @@ MaybeHandle<Object> JSObject::SetOwnPropertyIgnoreAttributes(
|
| STRICT),
|
| Object);
|
|
|
| - if (attributes != lookup.GetAttributes()) {
|
| - Handle<ExecutableAccessorInfo> new_data =
|
| - Accessors::CloneAccessor(
|
| - isolate, Handle<ExecutableAccessorInfo>::cast(callback));
|
| - new_data->set_property_attributes(attributes);
|
| - if (attributes & READ_ONLY) {
|
| - // This way we don't have to introduce a lookup to the setter,
|
| - // simply make it unavailable to reflect the attributes.
|
| - new_data->clear_setter();
|
| - }
|
| + if (attributes == lookup.GetAttributes()) return result;
|
| +
|
| + Handle<ExecutableAccessorInfo> new_data =
|
| + Accessors::CloneAccessor(
|
| + isolate, Handle<ExecutableAccessorInfo>::cast(callback));
|
| + new_data->set_property_attributes(attributes);
|
| + // This way we don't have to introduce a lookup to the setter, simply
|
| + // make it unavailable to reflect the attributes.
|
| + if (attributes & READ_ONLY) new_data->clear_setter();
|
| + SetPropertyCallback(object, name, new_data, attributes);
|
|
|
| - SetPropertyCallback(object, name, new_data, attributes);
|
| - }
|
| if (is_observed) {
|
| - // If we are setting the prototype of a function and are observed,
|
| - // don't send change records because the prototype handles that
|
| - // itself.
|
| - executed_set_prototype = object->IsJSFunction() &&
|
| - String::Equals(isolate->factory()->prototype_string(),
|
| - Handle<String>::cast(name)) &&
|
| - Handle<JSFunction>::cast(object)->should_have_prototype();
|
| + Handle<Object> new_value =
|
| + Object::GetPropertyOrElement(object, name).ToHandleChecked();
|
| + if (old_value->SameValue(*new_value)) {
|
| + old_value = isolate->factory()->the_hole_value();
|
| + }
|
| + EnqueueChangeRecord(object, "reconfigure", name, old_value);
|
| }
|
| - } else {
|
| - ConvertAndSetOwnProperty(&lookup, name, value, attributes);
|
| +
|
| + return result;
|
| }
|
| + ConvertAndSetOwnProperty(&lookup, name, value, attributes);
|
| break;
|
| }
|
| case NONEXISTENT:
|
| @@ -4335,7 +4328,7 @@ MaybeHandle<Object> JSObject::SetOwnPropertyIgnoreAttributes(
|
| }
|
| }
|
|
|
| - if (is_observed && !executed_set_prototype) {
|
| + if (is_observed) {
|
| if (lookup.IsTransition()) {
|
| EnqueueChangeRecord(object, "add", name, old_value);
|
| } else if (old_value->IsTheHole()) {
|
|
|