| Index: src/lookup.h
|
| diff --git a/src/lookup.h b/src/lookup.h
|
| index 3888ed624057231fd1d8266363ed6abf888849be..197987d684d73b901dee6582aaeab850f247f532 100644
|
| --- a/src/lookup.h
|
| +++ b/src/lookup.h
|
| @@ -133,16 +133,31 @@ class LookupIterator final BASE_EMBEDDED {
|
| }
|
|
|
| static LookupIterator PropertyOrElement(
|
| - Isolate* isolate, Handle<Object> receiver, Handle<Name> name,
|
| + Isolate* isolate, Handle<Object> receiver, Handle<Object> name,
|
| Configuration configuration = DEFAULT) {
|
| - name = Name::Flatten(name);
|
| + DCHECK(name->IsName() || name->IsNumber());
|
| +
|
| uint32_t index;
|
| - LookupIterator it =
|
| - name->AsArrayIndex(&index)
|
| - ? LookupIterator(isolate, receiver, index, configuration)
|
| - : LookupIterator(receiver, name, configuration);
|
| - it.name_ = name;
|
| - return it;
|
| + bool is_index = false;
|
| + if (name->IsNumber()) {
|
| + if (name->ToArrayIndex(&index)) {
|
| + is_index = true;
|
| + } else {
|
| + name = isolate->factory()->NumberToString(name);
|
| + }
|
| + } else {
|
| + DCHECK(name->IsName());
|
| + name = Name::Flatten(Handle<Name>::cast(name));
|
| + is_index = Handle<Name>::cast(name)->AsArrayIndex(&index);
|
| + }
|
| + if (is_index) {
|
| + return LookupIterator(isolate, receiver, index, configuration);
|
| + } else {
|
| + DCHECK(name->IsName());
|
| + LookupIterator it(receiver, Handle<Name>::cast(name), configuration);
|
| + it.name_ = Handle<Name>::cast(name);
|
| + return it;
|
| + }
|
| }
|
|
|
| static LookupIterator PropertyOrElement(
|
|
|