Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Unified Diff: src/runtime.cc

Issue 3027043: Revert r5165 (Added support for ES5's propertyname production)... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parser.cc ('k') | src/token.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
===================================================================
--- src/runtime.cc (revision 5181)
+++ src/runtime.cc (working copy)
@@ -305,13 +305,14 @@
}
Handle<Object> result;
uint32_t element_index = 0;
- if (key->ToArrayIndex(&element_index)) {
+ 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);
+ } else if (key->ToArrayIndex(&element_index)) {
// Array index (uint32).
result = SetElement(boilerplate, element_index, value);
- } else if (key->IsSymbol()) {
- // The key is not an array index.
- Handle<String> name(String::cast(*key));
- result = SetProperty(boilerplate, name, value, NONE);
} else {
// Non-uint32 number.
ASSERT(key->IsNumber());
« no previous file with comments | « src/parser.cc ('k') | src/token.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698