void __qmljs_inplace_bit_and_element(Value base, Value index, Value value, Context *ctx)
{
Object *obj = base.toObject(ctx).objectValue();
- if (ArrayObject *a = obj->asArrayObject()) {
- if (index.isNumber()) {
- const quint32 idx = index.toUInt32(ctx);
- Value v = a->value.at(idx);
- v = __qmljs_bit_and(v, value, ctx);
- a->value.assign(idx, v);
- return;
- }
- }
- String *name = index.toString(ctx);
- assert(name);
- obj->inplaceBinOp(value, ctx, name, __qmljs_bit_and);
+ obj->inplaceBinOp(value, index, __qmljs_bit_and, ctx);
}
void __qmljs_inplace_bit_or_element(Value base, Value index, Value value, Context *ctx)
{
Object *obj = base.toObject(ctx).objectValue();
- if (ArrayObject *a = obj->asArrayObject()) {
- if (index.isNumber()) {
- const quint32 idx = index.toUInt32(ctx);
- Value v = a->value.at(idx);
- v = __qmljs_bit_or(v, value, ctx);
- a->value.assign(idx, v);
- return;
- }
- }
- String *name = index.toString(ctx);
- assert(name);
- obj->inplaceBinOp(value, ctx, name, __qmljs_bit_or);
+ obj->inplaceBinOp(value, index, __qmljs_bit_or, ctx);
}
void __qmljs_inplace_bit_xor_element(Value base, Value index, Value value, Context *ctx)
{
Object *obj = base.toObject(ctx).objectValue();
- if (ArrayObject *a = obj->asArrayObject()) {
- if (index.isNumber()) {
- const quint32 idx = index.toUInt32(ctx);
- Value v = a->value.at(idx);
- v = __qmljs_bit_xor(v, value, ctx);
- a->value.assign(idx, v);
- return;
- }
- }
- String *name = index.toString(ctx);
- assert(name);
- obj->inplaceBinOp(value, ctx, name, __qmljs_bit_xor);
+ obj->inplaceBinOp(value, index, __qmljs_bit_xor, ctx);
}
void __qmljs_inplace_add_element(Value base, Value index, Value value, Context *ctx)
{
Object *obj = base.toObject(ctx).objectValue();
- if (ArrayObject *a = obj->asArrayObject()) {
- if (index.isNumber()) {
- const quint32 idx = index.toUInt32(ctx);
- Value v = a->value.at(idx);
- v = __qmljs_add(v, value, ctx);
- a->value.assign(idx, v);
- return;
- }
- }
- String *name = index.toString(ctx);
- assert(name);
- obj->inplaceBinOp(value, ctx, name, __qmljs_add);
+ obj->inplaceBinOp(value, index, __qmljs_add, ctx);
}
void __qmljs_inplace_sub_element(Value base, Value index, Value value, Context *ctx)
{
Object *obj = base.toObject(ctx).objectValue();
- if (ArrayObject *a = obj->asArrayObject()) {
- if (index.isNumber()) {
- const quint32 idx = index.toUInt32(ctx);
- Value v = a->value.at(idx);
- v = __qmljs_sub(v, value, ctx);
- a->value.assign(idx, v);
- return;
- }
- }
- String *name = index.toString(ctx);
- assert(name);
- obj->inplaceBinOp(value, ctx, name, __qmljs_sub);
+ obj->inplaceBinOp(value, index, __qmljs_sub, ctx);
}
void __qmljs_inplace_mul_element(Value base, Value index, Value value, Context *ctx)
{
Object *obj = base.toObject(ctx).objectValue();
- if (ArrayObject *a = obj->asArrayObject()) {
- if (index.isNumber()) {
- const quint32 idx = index.toUInt32(ctx);
- Value v = a->value.at(idx);
- v = __qmljs_mul(v, value, ctx);
- a->value.assign(idx, v);
- return;
- }
- }
- String *name = index.toString(ctx);
- assert(name);
- obj->inplaceBinOp(value, ctx, name, __qmljs_mul);
+ obj->inplaceBinOp(value, index, __qmljs_mul, ctx);
}
void __qmljs_inplace_div_element(Value base, Value index, Value value, Context *ctx)
{
Object *obj = base.toObject(ctx).objectValue();
- if (ArrayObject *a = obj->asArrayObject()) {
- if (index.isNumber()) {
- const quint32 idx = index.toUInt32(ctx);
- Value v = a->value.at(idx);
- v = __qmljs_div(v, value, ctx);
- a->value.assign(idx, v);
- return;
- }
- }
- String *name = index.toString(ctx);
- assert(name);
- obj->inplaceBinOp(value, ctx, name, __qmljs_div);
+ obj->inplaceBinOp(value, index, __qmljs_div, ctx);
}
void __qmljs_inplace_mod_element(Value base, Value index, Value value, Context *ctx)
{
Object *obj = base.toObject(ctx).objectValue();
- if (ArrayObject *a = obj->asArrayObject()) {
- if (index.isNumber()) {
- const quint32 idx = index.toUInt32(ctx);
- Value v = a->value.at(idx);
- v = __qmljs_mod(v, value, ctx);
- a->value.assign(idx, v);
- return;
- }
- }
- String *name = index.toString(ctx);
- assert(name);
- obj->inplaceBinOp(value, ctx, name, __qmljs_mod);
+ obj->inplaceBinOp(value, index, __qmljs_mod, ctx);
}
void __qmljs_inplace_shl_element(Value base, Value index, Value value, Context *ctx)
{
Object *obj = base.toObject(ctx).objectValue();
- if (ArrayObject *a = obj->asArrayObject()) {
- if (index.isNumber()) {
- const quint32 idx = index.toUInt32(ctx);
- Value v = a->value.at(idx);
- v = __qmljs_shl(v, value, ctx);
- a->value.assign(idx, v);
- return;
- }
- }
- String *name = index.toString(ctx);
- assert(name);
- obj->inplaceBinOp(value, ctx, name, __qmljs_shl);
+ obj->inplaceBinOp(value, index, __qmljs_shl, ctx);
}
void __qmljs_inplace_shr_element(Value base, Value index, Value value, Context *ctx)
{
Object *obj = base.toObject(ctx).objectValue();
- if (ArrayObject *a = obj->asArrayObject()) {
- if (index.isNumber()) {
- const quint32 idx = index.toUInt32(ctx);
- Value v = a->value.at(idx);
- v = __qmljs_shr(v, value, ctx);
- a->value.assign(idx, v);
- return;
- }
- }
- String *name = index.toString(ctx);
- assert(name);
- obj->inplaceBinOp(value, ctx, name, __qmljs_shr);
+ obj->inplaceBinOp(value, index, __qmljs_shr, ctx);
}
void __qmljs_inplace_ushr_element(Value base, Value index, Value value, Context *ctx)
{
Object *obj = base.toObject(ctx).objectValue();
- if (ArrayObject *a = obj->asArrayObject()) {
- if (index.isNumber()) {
- const quint32 idx = index.toUInt32(ctx);
- Value v = a->value.at(idx);
- v = __qmljs_ushr(v, value, ctx);
- a->value.assign(idx, v);
- return;
- }
- }
- String *name = index.toString(ctx);
- assert(name);
- obj->inplaceBinOp(value, ctx, name, __qmljs_ushr);
+ obj->inplaceBinOp(value, index, __qmljs_ushr, ctx);
}
void __qmljs_inplace_bit_and_member(Value value, Value base, String *name, Context *ctx)