id_get = newIdentifier(QStringLiteral("get"));
id_set = newIdentifier(QStringLiteral("set"));
id_eval = newIdentifier(QStringLiteral("eval"));
+ id_uintMax = newIdentifier(QStringLiteral("4294967295"));
emptyClass = new InternalClass(this);
arrayClass = emptyClass->addMember(id_length, Attr_NotConfigurable|Attr_NotEnumerable);
id_get->mark();
id_set->mark();
id_eval->mark();
+ id_uintMax->mark();
}
Value ExecutionEngine::run(Function *function, ExecutionContext *ctx)
QV4::ExecutionContext *ctx = d->engine->current;
try {
- QV4::Value v = o->getIndexed(ctx, arrayIndex);
+ QV4::Value v = arrayIndex == UINT_MAX ? o->get(ctx, ctx->engine->id_uintMax) : o->getIndexed(ctx, arrayIndex);
return new QJSValuePrivate(d->engine, v);
} catch (QV4::Exception &e) {
e.accept(ctx);
QV4::ExecutionContext *ctx = d->engine->current;
try {
- o->putIndexed(ctx, arrayIndex, value.d->value);
+ if (arrayIndex != UINT_MAX)
+ o->putIndexed(ctx, arrayIndex, value.d->value);
+ else
+ o->put(ctx, ctx->engine->id_uintMax, value.d->value);
} catch (QV4::Exception &e) {
e.accept(ctx);
}