| Index: src/handles.cc
|
| diff --git a/src/handles.cc b/src/handles.cc
|
| index 7a473ae6e626b718ec74ad143941aa0269b70cf0..931e3b9bf0ff0f685a4560bf017189a30c5a9122 100644
|
| --- a/src/handles.cc
|
| +++ b/src/handles.cc
|
| @@ -531,57 +531,49 @@ Handle<FixedArray> GetKeysInFixedArrayFor(Handle<JSObject> object,
|
| KeyCollectionType type) {
|
| Handle<FixedArray> content = Factory::empty_fixed_array();
|
|
|
| - JSObject* arguments_boilerplate =
|
| - Top::context()->global_context()->arguments_boilerplate();
|
| - JSFunction* arguments_function =
|
| - JSFunction::cast(arguments_boilerplate->map()->constructor());
|
| - bool allow_enumeration = (object->map()->constructor() != arguments_function);
|
| -
|
| // Only collect keys if access is permitted.
|
| - if (allow_enumeration) {
|
| - for (Handle<Object> p = object;
|
| - *p != Heap::null_value();
|
| - p = Handle<Object>(p->GetPrototype())) {
|
| - Handle<JSObject> current(JSObject::cast(*p));
|
| -
|
| - // Check access rights if required.
|
| - if (current->IsAccessCheckNeeded() &&
|
| - !Top::MayNamedAccess(*current, Heap::undefined_value(),
|
| - v8::ACCESS_KEYS)) {
|
| - Top::ReportFailedAccessCheck(*current, v8::ACCESS_KEYS);
|
| - break;
|
| - }
|
| -
|
| - // Compute the element keys.
|
| - Handle<FixedArray> element_keys =
|
| - Factory::NewFixedArray(current->NumberOfEnumElements());
|
| - current->GetEnumElementKeys(*element_keys);
|
| - content = UnionOfKeys(content, element_keys);
|
| -
|
| - // Add the element keys from the interceptor.
|
| - if (current->HasIndexedInterceptor()) {
|
| - v8::Handle<v8::Array> result =
|
| - GetKeysForIndexedInterceptor(object, current);
|
| - if (!result.IsEmpty())
|
| - content = AddKeysFromJSArray(content, v8::Utils::OpenHandle(*result));
|
| - }
|
| + for (Handle<Object> p = object;
|
| + *p != Heap::null_value();
|
| + p = Handle<Object>(p->GetPrototype())) {
|
| + Handle<JSObject> current(JSObject::cast(*p));
|
| +
|
| + // Check access rights if required.
|
| + if (current->IsAccessCheckNeeded() &&
|
| + !Top::MayNamedAccess(*current, Heap::undefined_value(),
|
| + v8::ACCESS_KEYS)) {
|
| + Top::ReportFailedAccessCheck(*current, v8::ACCESS_KEYS);
|
| + break;
|
| + }
|
|
|
| - // Compute the property keys.
|
| - content = UnionOfKeys(content, GetEnumPropertyKeys(current));
|
| + // Compute the element keys.
|
| + Handle<FixedArray> element_keys =
|
| + Factory::NewFixedArray(current->NumberOfEnumElements());
|
| + current->GetEnumElementKeys(*element_keys);
|
| + content = UnionOfKeys(content, element_keys);
|
| +
|
| + // Add the element keys from the interceptor.
|
| + if (current->HasIndexedInterceptor()) {
|
| + v8::Handle<v8::Array> result =
|
| + GetKeysForIndexedInterceptor(object, current);
|
| + if (!result.IsEmpty())
|
| + content = AddKeysFromJSArray(content, v8::Utils::OpenHandle(*result));
|
| + }
|
|
|
| - // Add the property keys from the interceptor.
|
| - if (current->HasNamedInterceptor()) {
|
| - v8::Handle<v8::Array> result =
|
| - GetKeysForNamedInterceptor(object, current);
|
| - if (!result.IsEmpty())
|
| - content = AddKeysFromJSArray(content, v8::Utils::OpenHandle(*result));
|
| - }
|
| + // Compute the property keys.
|
| + content = UnionOfKeys(content, GetEnumPropertyKeys(current));
|
|
|
| - // If we only want local properties we bail out after the first
|
| - // iteration.
|
| - if (type == LOCAL_ONLY)
|
| - break;
|
| + // Add the property keys from the interceptor.
|
| + if (current->HasNamedInterceptor()) {
|
| + v8::Handle<v8::Array> result =
|
| + GetKeysForNamedInterceptor(object, current);
|
| + if (!result.IsEmpty())
|
| + content = AddKeysFromJSArray(content, v8::Utils::OpenHandle(*result));
|
| }
|
| +
|
| + // If we only want local properties we bail out after the first
|
| + // iteration.
|
| + if (type == LOCAL_ONLY)
|
| + break;
|
| }
|
| return content;
|
| }
|
|
|