Chromium Code Reviews| Index: src/objects.cc |
| diff --git a/src/objects.cc b/src/objects.cc |
| index d9da23f363ed1e18e363ff3e79b0fe02d348cc29..526187e155769b137c807fdabc0271ed1a509906 100644 |
| --- a/src/objects.cc |
| +++ b/src/objects.cc |
| @@ -3370,11 +3370,6 @@ PropertyAttributes JSObject::GetElementAttributeWithReceiver( |
| return GetElementAttributeWithInterceptor(receiver, index, continue_search); |
| } |
| - // Handle [] on String objects. |
|
rossberg
2013/02/25 10:46:25
I'm not sure removing this is correct. This functi
Michael Starzinger
2013/02/25 14:29:08
I agree with this comment. I think this can be tri
adamk
2013/02/25 19:36:03
I've added a test case covering this case, and it
|
| - if (this->IsStringObjectWithCharacterAt(index)) { |
| - return static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE); |
| - } |
| - |
| return GetElementAttributeWithoutInterceptor( |
| receiver, index, continue_search); |
| } |
| @@ -3426,28 +3421,25 @@ PropertyAttributes JSObject::GetElementAttributeWithInterceptor( |
| PropertyAttributes JSObject::GetElementAttributeWithoutInterceptor( |
| JSReceiver* receiver, uint32_t index, bool continue_search) { |
| - Isolate* isolate = GetIsolate(); |
| - HandleScope scope(isolate); |
| - Handle<JSReceiver> hreceiver(receiver); |
| - Handle<JSObject> holder(this); |
| - PropertyAttributes attr = holder->GetElementsAccessor()->GetAttributes( |
| - *hreceiver, *holder, index); |
| + PropertyAttributes attr = GetElementsAccessor()->GetAttributes( |
| + receiver, this, index); |
| if (attr != ABSENT) return attr; |
| - if (holder->IsStringObjectWithCharacterAt(index)) { |
| + // Handle [] on String objects. |
| + if (IsStringObjectWithCharacterAt(index)) { |
| return static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE); |
| } |
| if (!continue_search) return ABSENT; |
| - Object* pt = holder->GetPrototype(); |
| + Object* pt = GetPrototype(); |
| if (pt->IsJSProxy()) { |
| // We need to follow the spec and simulate a call to [[GetOwnProperty]]. |
| - return JSProxy::cast(pt)->GetElementAttributeWithHandler(*hreceiver, index); |
| + return JSProxy::cast(pt)->GetElementAttributeWithHandler(receiver, index); |
| } |
| if (pt->IsNull()) return ABSENT; |
| return JSObject::cast(pt)->GetElementAttributeWithReceiver( |
| - *hreceiver, index, true); |
| + receiver, index, true); |
| } |