ValueType value_type,
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
old_attributes = lookup.GetAttributes();
}
- bool executed_set_prototype = false;
-
// Check of IsReadOnly removed from here in clone.
if (lookup.IsTransition()) {
Handle<Object> result;
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,
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:
}
}
- if (is_observed && !executed_set_prototype) {
+ if (is_observed) {
if (lookup.IsTransition()) {
EnqueueChangeRecord(object, "add", name, old_value);
} else if (old_value->IsTheHole()) {
StrictMode strict_mode,
StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED);
- // SetLocalPropertyIgnoreAttributes converts callbacks to fields. We need to
- // grant an exemption to ExecutableAccessor callbacks in some cases.
- enum ExecutableAccessorInfoHandling {
- DEFAULT_HANDLING,
- DONT_FORCE_FIELD
- };
-
MUST_USE_RESULT static MaybeHandle<Object> SetOwnPropertyIgnoreAttributes(
Handle<JSObject> object,
Handle<Name> key,
ValueType value_type = OPTIMAL_REPRESENTATION,
StoreMode mode = ALLOW_AS_CONSTANT,
ExtensibilityCheck extensibility_check = PERFORM_EXTENSIBILITY_CHECK,
- StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED,
- ExecutableAccessorInfoHandling handling = DEFAULT_HANDLING);
+ StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED);
static void AddProperty(Handle<JSObject> object,
Handle<Name> key,
CHECK_EQ(3, global->Get(access_property)->Int32Value());
CHECK_EQ(1, force_set_set_count);
CHECK_EQ(2, force_set_get_count);
- // Forcing the property to be set should override the accessor without
- // calling it
+ // Forcing the property to be set should call the accessor
global->ForceSet(access_property, v8::Int32::New(isolate, 8));
- CHECK_EQ(8, global->Get(access_property)->Int32Value());
- CHECK_EQ(1, force_set_set_count);
- CHECK_EQ(2, force_set_get_count);
+ CHECK_EQ(3, global->Get(access_property)->Int32Value());
+ CHECK_EQ(2, force_set_set_count);
+ CHECK_EQ(3, force_set_get_count);
}
// createProxy(Proxy.create, null),
// createProxy(Proxy.createFunction, function(){}),
];
-var properties = ["a", "1", 1, "length", "setPrototype", "name", "caller"];
+var properties = ["a", "1", 1, "length", "setPrototype",
+ "name", "caller", "prototype"];
// Cases that yield non-standard results.
function blacklisted(obj, prop) {