Index: src/lookup.cc |
diff --git a/src/lookup.cc b/src/lookup.cc |
index 38cc522c6e0833fb740b9a8cbb00fd88d8e3d185..aa66d152e39a9cae781a9978f6fa2facecac6825 100644 |
--- a/src/lookup.cc |
+++ b/src/lookup.cc |
@@ -264,6 +264,13 @@ Handle<Object> LookupIterator::FetchValue() const { |
Handle<JSObject> holder = GetHolder<JSObject>(); |
if (IsElement()) { |
// TODO(verwaest): Optimize. |
+ if (holder->IsStringObjectWithCharacterAt(index_)) { |
+ Handle<JSValue> js_value = Handle<JSValue>::cast(holder); |
+ Handle<String> string(String::cast(js_value->value())); |
+ return factory()->LookupSingleCharacterStringFromCode( |
+ String::Flatten(string)->Get(index_)); |
+ } |
+ |
ElementsAccessor* accessor = holder->GetElementsAccessor(); |
return accessor->Get(holder, index_); |
} else if (holder_map_->IsGlobalObjectMap()) { |