| Index: src/objects-inl.h
|
| diff --git a/src/objects-inl.h b/src/objects-inl.h
|
| index fe8964f8504374a844a22e8afbbb2dba22417d6a..833b4a89e9fad45e868e52226d8ae6e9a6038832 100644
|
| --- a/src/objects-inl.h
|
| +++ b/src/objects-inl.h
|
| @@ -5083,6 +5083,12 @@ PropertyAttributes JSReceiver::GetPropertyAttribute(String* key) {
|
| return GetPropertyAttributeWithReceiver(this, key);
|
| }
|
|
|
| +
|
| +PropertyAttributes JSReceiver::GetElementAttribute(uint32_t index) {
|
| + return GetElementAttributeWithReceiver(this, index, true);
|
| +}
|
| +
|
| +
|
| // TODO(504): this may be useful in other places too where JSGlobalProxy
|
| // is used.
|
| Object* JSObject::BypassGlobalProxy() {
|
| @@ -5107,7 +5113,34 @@ bool JSReceiver::HasElement(uint32_t index) {
|
| if (IsJSProxy()) {
|
| return JSProxy::cast(this)->HasElementWithHandler(index);
|
| }
|
| - return JSObject::cast(this)->HasElementWithReceiver(this, index);
|
| + return JSObject::cast(this)->GetElementAttribute(index) != ABSENT;
|
| +}
|
| +
|
| +
|
| +bool JSReceiver::HasLocalElement(uint32_t index) {
|
| + if (IsJSProxy()) {
|
| + return JSProxy::cast(this)->HasElementWithHandler(index);
|
| + }
|
| + return JSObject::cast(this)->GetLocalElementAttribute(index) != ABSENT;
|
| +}
|
| +
|
| +
|
| +PropertyAttributes JSReceiver::GetElementAttributeWithReceiver(
|
| + JSReceiver* receiver, uint32_t index, bool continue_search) {
|
| + if (IsJSProxy()) {
|
| + return JSProxy::cast(this)->GetElementAttributeWithHandler(receiver, index);
|
| + }
|
| + return JSObject::cast(this)->GetElementAttributeWithReceiver(
|
| + receiver, index, continue_search);
|
| +}
|
| +
|
| +
|
| +PropertyAttributes JSReceiver::GetLocalElementAttribute(uint32_t index) {
|
| + if (IsJSProxy()) {
|
| + return JSProxy::cast(this)->GetElementAttributeWithHandler(this, index);
|
| + }
|
| + return JSObject::cast(this)->GetElementAttributeWithReceiver(
|
| + this, index, false);
|
| }
|
|
|
|
|
|
|