Revert of OrdinaryDefineOwnProperty: always reset the LookupIterator before storing. (patchset #1 id:1 of https://codereview.chromium.org/1415823003/ )
Reason for revert: Breaks test if rolled into Chromium: http://build.chromium.org/p/chromium.win/buildstatus?builder=Vista%20Tests%20%281%29&number=60441 Original issue's description: > OrdinaryDefineOwnProperty: always reset the LookupIterator before storing. > > Committed: https://crrev.com/7bc5ce16ee9244869384cdf17ea2feb0a9dde9bd > Cr-Commit-Position: refs/heads/master@{#31511} TBR=cbruni@chromium.org,jkummerow@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1418303002 Cr-Commit-Position: refs/heads/master@{#31533}
This commit is contained in:
parent
a0f5d4995c
commit
dc9d2c16cd
@ -6089,11 +6089,6 @@ bool JSReceiver::OrdinaryDefineOwnProperty(LookupIterator* it,
|
||||
isolate->has_pending_exception()) {
|
||||
return false;
|
||||
}
|
||||
// TODO(jkummerow/verwaest): It would be nice if we didn't have to reset
|
||||
// the iterator every time. Currently, the reasons why we need it are:
|
||||
// - handle interceptors correctly
|
||||
// - handle accessors correctly (which might change the holder's map)
|
||||
it->Restart();
|
||||
// 3. Let extensible be the value of the [[Extensible]] internal slot of O.
|
||||
Handle<JSObject> object = Handle<JSObject>::cast(it->GetReceiver());
|
||||
bool extensible = JSObject::IsExtensible(object);
|
||||
@ -6115,6 +6110,13 @@ bool JSReceiver::OrdinaryDefineOwnProperty(LookupIterator* it,
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// We have to reset the LookupIterator to handle interceptors properly.
|
||||
Map* map = Handle<HeapObject>::cast(object)->map();
|
||||
if ((it->IsElement() && map->has_indexed_interceptor()) ||
|
||||
(!it->IsElement() && map->has_named_interceptor())) {
|
||||
it->Restart();
|
||||
}
|
||||
|
||||
// 2c. If IsGenericDescriptor(Desc) or IsDataDescriptor(Desc) is true, then:
|
||||
// (This is equivalent to !IsAccessorDescriptor(desc).)
|
||||
DCHECK((desc_is_generic_descriptor || desc_is_data_descriptor) ==
|
||||
|
Loading…
Reference in New Issue
Block a user