Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index 724a4363483e0aa3a806f73cdb8a24fa8958441f..5dc6998cf8832bf7112eea4bea7ff07ef89018b7 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -330,13 +330,18 @@ static Handle<Object> CreateObjectLiteralBoilerplate( |
Handle<Object> result; |
uint32_t element_index = 0; |
if (key->IsSymbol()) { |
- // If key is a symbol it is not an array element. |
- Handle<String> name(String::cast(*key)); |
- ASSERT(!name->AsArrayIndex(&element_index)); |
- result = SetProperty(boilerplate, name, value, NONE); |
+ if (Handle<String>::cast(key)->AsArrayIndex(&element_index)) { |
+ // Array index as string (uint32). |
+ result = SetOwnElement(boilerplate, element_index, value); |
+ } else { |
+ Handle<String> name(String::cast(*key)); |
+ ASSERT(!name->AsArrayIndex(&element_index)); |
+ result = IgnoreAttributesAndSetLocalProperty(boilerplate, name, |
+ value, NONE); |
+ } |
} else if (key->ToArrayIndex(&element_index)) { |
// Array index (uint32). |
- result = SetElement(boilerplate, element_index, value); |
+ result = SetOwnElement(boilerplate, element_index, value); |
} else { |
// Non-uint32 number. |
ASSERT(key->IsNumber()); |
@@ -345,7 +350,8 @@ static Handle<Object> CreateObjectLiteralBoilerplate( |
Vector<char> buffer(arr, ARRAY_SIZE(arr)); |
const char* str = DoubleToCString(num, buffer); |
Handle<String> name = Factory::NewStringFromAscii(CStrVector(str)); |
- result = SetProperty(boilerplate, name, value, NONE); |
+ result = IgnoreAttributesAndSetLocalProperty(boilerplate, name, |
+ value, NONE); |
} |
// If setting the property on the boilerplate throws an |
// exception, the exception is converted to an empty handle in |