int JSObject::GetOwnElementKeys(FixedArray* storage,
PropertyAttributes filter) {
int counter = 0;
+
+ // If this is a String wrapper, add the string indices first,
+ // as they're guaranteed to preced the elements in numerical order
+ // and ascending order is required by ECMA-262, 6th, 9.1.12.
+ if (IsJSValue()) {
+ Object* val = JSValue::cast(this)->value();
+ if (val->IsString()) {
+ String* str = String::cast(val);
+ if (storage) {
+ for (int i = 0; i < str->length(); i++) {
+ storage->set(counter + i, Smi::FromInt(i));
+ }
+ }
+ counter += str->length();
+ }
+ }
+
switch (GetElementsKind()) {
case FAST_SMI_ELEMENTS:
case FAST_ELEMENTS:
}
}
- if (this->IsJSValue()) {
- Object* val = JSValue::cast(this)->value();
- if (val->IsString()) {
- String* str = String::cast(val);
- if (storage) {
- for (int i = 0; i < str->length(); i++) {
- storage->set(counter + i, Smi::FromInt(i));
- }
- }
- counter += str->length();
- }
- }
DCHECK(!storage || storage->length() == counter);
return counter;
}
'built-ins/Boolean/prototype/valueOf/S15.6.4.3_A1_T1': [FAIL],
'built-ins/Boolean/prototype/valueOf/S15.6.4.3_A1_T2': [FAIL],
- # https://code.google.com/p/v8/issues/detail?id=4118
- 'built-ins/Object/getOwnPropertyNames/15.2.3.4-4-44': [FAIL],
-
# https://code.google.com/p/v8/issues/detail?id=3087
'built-ins/Array/prototype/every/15.4.4.16-3-12': [FAIL],
'built-ins/Array/prototype/every/15.4.4.16-3-14': [FAIL],