Commit 2e8b8d3d authored by lrn@chromium.org's avatar lrn@chromium.org

Fix bad assumption in object literal interpretation.

We allow symbols that are array indices.

Review URL: http://codereview.chromium.org/6304016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6447 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8d79f3a7
......@@ -239,12 +239,19 @@ void ObjectLiteral::CalculateEmitStore() {
HashMap* table;
void* key;
uint32_t index;
Smi* smi_key_location;
if (handle->IsSymbol()) {
Handle<String> name(String::cast(*handle));
ASSERT(!name->AsArrayIndex(&index));
key = name.location();
hash = name->Hash();
table = &properties;
if (name->AsArrayIndex(&index)) {
smi_key_location = Smi::FromInt(index);
key = &smi_key_location;
hash = index;
table = &elements;
} else {
key = name.location();
hash = name->Hash();
table = &properties;
}
} else if (handle->ToArrayIndex(&index)) {
key = handle.location();
hash = index;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment