Remove API check for interceptors to notify us of modifying the receiver

BUG=chromium:679345
R=verwaest@chromium.org

Review-Url: https://codereview.chromium.org/2622873002
Cr-Commit-Position: refs/heads/master@{#42173}
This commit is contained in:
jochen 2017-01-10 04:22:21 -08:00 committed by Commit bot
parent 544bd08c7f
commit ed43c63e26

View File

@ -4923,21 +4923,10 @@ Maybe<bool> Object::SetPropertyInternal(LookupIterator* it,
value, it->GetReceiver(), language_mode); value, it->GetReceiver(), language_mode);
case LookupIterator::INTERCEPTOR: { case LookupIterator::INTERCEPTOR: {
Handle<Map> store_target_map;
if (it->GetReceiver()->IsJSObject()) {
store_target_map = handle(it->GetStoreTarget()->map(), it->isolate());
}
if (it->HolderIsReceiverOrHiddenPrototype()) { if (it->HolderIsReceiverOrHiddenPrototype()) {
Maybe<bool> result = Maybe<bool> result =
JSObject::SetPropertyWithInterceptor(it, should_throw, value); JSObject::SetPropertyWithInterceptor(it, should_throw, value);
if (result.IsNothing() || result.FromJust()) return result; if (result.IsNothing() || result.FromJust()) return result;
// Interceptor modified the store target but failed to set the
// property.
Utils::ApiCheck(store_target_map.is_null() ||
*store_target_map == it->GetStoreTarget()->map(),
it->IsElement() ? "v8::IndexedPropertySetterCallback"
: "v8::NamedPropertySetterCallback",
"Interceptor silently changed store target.");
} else { } else {
Maybe<PropertyAttributes> maybe_attributes = Maybe<PropertyAttributes> maybe_attributes =
JSObject::GetPropertyAttributesWithInterceptor(it); JSObject::GetPropertyAttributesWithInterceptor(it);
@ -4945,13 +4934,6 @@ Maybe<bool> Object::SetPropertyInternal(LookupIterator* it,
if ((maybe_attributes.FromJust() & READ_ONLY) != 0) { if ((maybe_attributes.FromJust() & READ_ONLY) != 0) {
return WriteToReadOnlyProperty(it, value, should_throw); return WriteToReadOnlyProperty(it, value, should_throw);
} }
// Interceptor modified the store target but failed to set the
// property.
Utils::ApiCheck(store_target_map.is_null() ||
*store_target_map == it->GetStoreTarget()->map(),
it->IsElement() ? "v8::IndexedPropertySetterCallback"
: "v8::NamedPropertySetterCallback",
"Interceptor silently changed store target.");
if (maybe_attributes.FromJust() == ABSENT) break; if (maybe_attributes.FromJust() == ABSENT) break;
*found = false; *found = false;
return Nothing<bool>(); return Nothing<bool>();
@ -6841,29 +6823,12 @@ Maybe<bool> JSReceiver::OrdinaryDefineOwnProperty(Isolate* isolate,
// Handle interceptor // Handle interceptor
if (it.state() == LookupIterator::INTERCEPTOR) { if (it.state() == LookupIterator::INTERCEPTOR) {
Handle<Map> store_target_map;
if (it.GetReceiver()->IsJSObject()) {
store_target_map = handle(it.GetStoreTarget()->map(), it.isolate());
}
if (it.HolderIsReceiverOrHiddenPrototype()) { if (it.HolderIsReceiverOrHiddenPrototype()) {
Maybe<bool> result = DefinePropertyWithInterceptorInternal( Maybe<bool> result = DefinePropertyWithInterceptorInternal(
&it, it.GetInterceptor(), should_throw, *desc); &it, it.GetInterceptor(), should_throw, *desc);
if (result.IsNothing() || result.FromJust()) { if (result.IsNothing() || result.FromJust()) {
return result; return result;
} }
// Interceptor modified the store target but failed to set the
// property.
if (!store_target_map.is_null() &&
*store_target_map != it.GetStoreTarget()->map()) {
it.isolate()->PushStackTraceAndDie(
0xabababaa, v8::ToCData<void*>(it.GetInterceptor()->definer()),
nullptr, 0xabababab);
}
Utils::ApiCheck(store_target_map.is_null() ||
*store_target_map == it.GetStoreTarget()->map(),
it.IsElement() ? "v8::IndexedPropertyDefinerCallback"
: "v8::NamedPropertyDefinerCallback",
"Interceptor silently changed store target.");
} }
} }