The string is immutable, thus queries indexing into the
string data need to return Attr_NotWritable|Attr_NotConfigurable
(see 15.5.5.2 of the ecma spec).
Change-Id: I180d983b04a209c29fcd37b11682999b57bc42fe
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
return o->arrayData->attributes(index);
if (o->isStringObject()) {
- Property *p = static_cast<const StringObject *>(o)->getIndex(index);
- if (p)
- return Attr_Data;
+ String *s = static_cast<const StringObject *>(o)->value.asString();
+ if (index < (uint)s->length())
+ return (Attr_NotWritable|Attr_NotConfigurable);
}
return Attr_Invalid;
}