}
} else {
for (uint i = 0; i < ctx->argumentCount; ++i)
- instance->putIndexed(ctx, len + i, ctx->argument(i));
+ instance->putIndexed(len + i, ctx->argument(i));
len += ctx->argumentCount;
}
if (instance->isArrayObject())
Value lval = instance->getIndexed(lo, &loExists);
Value hval = instance->getIndexed(hi, &hiExists);
if (hiExists)
- instance->putIndexed(ctx, lo, hval);
+ instance->putIndexed(lo, hval);
else
instance->deleteIndexedProperty(lo);
if (loExists)
- instance->putIndexed(ctx, hi, lval);
+ instance->putIndexed(hi, lval);
else
instance->deleteIndexedProperty(hi);
}
bool exists;
Value v = instance->getIndexed(k, &exists);
if (exists)
- instance->putIndexed(ctx, k - 1, v);
+ instance->putIndexed(k - 1, v);
else
instance->deleteIndexedProperty(k - 1);
}
bool exists;
Value v = instance->getIndexed(k - 1, &exists);
if (exists)
- instance->putIndexed(ctx, k + ctx->argumentCount - 1, v);
+ instance->putIndexed(k + ctx->argumentCount - 1, v);
else
instance->deleteIndexedProperty(k + ctx->argumentCount - 1);
}
for (uint i = 0; i < ctx->argumentCount; ++i)
- instance->putIndexed(ctx, i, ctx->argument(i));
+ instance->putIndexed(i, ctx->argument(i));
}
uint newLen = len + ctx->argumentCount;
Value (*get)(Managed *, String *name, bool *hasProperty);
Value (*getIndexed)(Managed *, uint index, bool *hasProperty);
void (*put)(Managed *, ExecutionContext *ctx, String *name, const Value &value);
- void (*putIndexed)(Managed *, ExecutionContext *ctx, uint index, const Value &value);
+ void (*putIndexed)(Managed *, uint index, const Value &value);
PropertyAttributes (*query)(const Managed *, String *name);
PropertyAttributes (*queryIndexed)(const Managed *, uint index);
bool (*deleteProperty)(Managed *m, String *name);
Value getIndexed(uint index, bool *hasProperty = 0);
void put(ExecutionContext *ctx, String *name, const Value &value)
{ vtbl->put(this, ctx, name, value); }
- void putIndexed(ExecutionContext *ctx, uint index, const Value &value)
- { vtbl->putIndexed(this, ctx, index, value); }
+ void putIndexed(uint index, const Value &value)
+ { vtbl->putIndexed(this, index, value); }
PropertyAttributes query(String *name) const
{ return vtbl->query(this, name); }
PropertyAttributes queryIndexed(uint index) const
Value v = getIndexed(idx, &hasProperty);
Value result;
op(ctx, &result, v, rhs);
- putIndexed(ctx, idx, result);
+ putIndexed(idx, result);
return;
}
String *name = index.toString(ctx);
static_cast<Object *>(m)->internalPut(ctx, name, value);
}
-void Object::putIndexed(Managed *m, ExecutionContext *ctx, uint index, const Value &value)
+void Object::putIndexed(Managed *m, uint index, const Value &value)
{
- static_cast<Object *>(m)->internalPutIndexed(ctx, index, value);
+ static_cast<Object *>(m)->internalPutIndexed(index, value);
}
PropertyAttributes Object::query(const Managed *m, String *name)
{
uint idx = name->asArrayIndex();
if (idx != UINT_MAX)
- return putIndexed(ctx, idx, value);
+ return putIndexed(idx, value);
name->makeIdentifier(ctx);
}
}
-void Object::internalPutIndexed(ExecutionContext *ctx, uint index, const Value &value)
+void Object::internalPutIndexed(uint index, const Value &value)
{
Property *pd = 0;
PropertyAttributes attrs;
Value args[1];
args[0] = value;
- pd->setter()->call(ctx, Value::fromObject(this), args, 1);
+ pd->setter()->call(engine()->current, Value::fromObject(this), args, 1);
return;
}
return;
reject:
- if (ctx->strictMode)
- ctx->throwTypeError();
+ if (engine()->current->strictMode)
+ engine()->current->throwTypeError();
}
// Section 8.12.7
inline void put(String *name, const Value &v)
{ vtbl->put(this, engine()->current, name, v); }
inline void putIndexed(uint idx, const Value &v)
- { vtbl->putIndexed(this, engine()->current, idx, v); }
+ { vtbl->putIndexed(this, idx, v); }
using Managed::get;
using Managed::getIndexed;
using Managed::put;
static Value get(Managed *m, String *name, bool *hasProperty);
static Value getIndexed(Managed *m, uint index, bool *hasProperty);
static void put(Managed *m, ExecutionContext *ctx, String *name, const Value &value);
- static void putIndexed(Managed *m, ExecutionContext *ctx, uint index, const Value &value);
+ static void putIndexed(Managed *m, uint index, const Value &value);
static PropertyAttributes query(const Managed *m, String *name);
static PropertyAttributes queryIndexed(const Managed *m, uint index);
static bool deleteProperty(Managed *m, String *name);
Value internalGet(String *name, bool *hasProperty);
Value internalGetIndexed(uint index, bool *hasProperty);
void internalPut(ExecutionContext *ctx, String *name, const Value &value);
- void internalPutIndexed(ExecutionContext *ctx, uint index, const Value &value);
+ void internalPutIndexed(uint index, const Value &value);
bool internalDeleteProperty(String *name);
bool internalDeleteIndexedProperty(uint index);
{
}
-void RegExp::putIndexed(Managed *m, ExecutionContext *ctx, uint index, const Value &value)
+void RegExp::putIndexed(Managed *m, uint index, const Value &value)
{
}
static Value get(Managed *m, String *name, bool *hasProperty);
static Value getIndexed(Managed *m, uint index, bool *hasProperty);
static void put(Managed *m, ExecutionContext *ctx, String *name, const Value &value);
- static void putIndexed(Managed *m, ExecutionContext *ctx, uint index, const Value &value);
+ static void putIndexed(Managed *m, uint index, const Value &value);
static PropertyAttributes query(const Managed *m, String *name);
static PropertyAttributes queryIndexed(const Managed *m, uint index);
static bool deleteProperty(Managed *, String *);
return;
}
}
- o->putIndexed(ctx, idx, value);
+ o->putIndexed(idx, value);
return;
}
v = Value::fromDouble(d + 1);
}
- o->putIndexed(context, idx, v);
+ o->putIndexed(idx, v);
}
void __qmljs_builtin_post_decrement(Value *result, Value *val)
v = Value::fromDouble(d - 1);
}
- o->putIndexed(context, idx, v);
+ o->putIndexed(idx, v);
}
ExecutionContext *__qmljs_builtin_push_with_scope(const Value &o, ExecutionContext *ctx)
return QV4::Value::undefinedValue();
}
- void containerPutIndexed(QV4::ExecutionContext *ctx, uint index, const QV4::Value &value)
+ void containerPutIndexed(uint index, const QV4::Value &value)
{
/* Qt containers have int (rather than uint) allowable indexes. */
if (index > INT_MAX) {
- generateWarning(ctx, QLatin1String("Index out of range during indexed set"));
+ generateWarning(engine()->current, QLatin1String("Index out of range during indexed set"));
return;
}
static QV4::Value getIndexed(QV4::Managed *that, uint index, bool *hasProperty)
{ return static_cast<QQmlSequence<Container> *>(that)->containerGetIndexed(index, hasProperty); }
- static void putIndexed(Managed *that, QV4::ExecutionContext *ctx, uint index, const QV4::Value &value)
- { static_cast<QQmlSequence<Container> *>(that)->containerPutIndexed(ctx, index, value); }
+ static void putIndexed(Managed *that, uint index, const QV4::Value &value)
+ { static_cast<QQmlSequence<Container> *>(that)->containerPutIndexed(index, value); }
static QV4::PropertyAttributes queryIndexed(const QV4::Managed *that, uint index)
{ return static_cast<const QQmlSequence<Container> *>(that)->containerQueryIndexed(index); }
static bool deleteIndexedProperty(QV4::Managed *that, uint index)
o->put(ctx, name, value);
}
-void String::putIndexed(Managed *m, ExecutionContext *ctx, uint index, const Value &value)
+void String::putIndexed(Managed *m, uint index, const Value &value)
{
String *that = static_cast<String *>(m);
- Object *o = ctx->engine->newStringObject(Value::fromString(that));
- o->putIndexed(ctx, index, value);
+ Object *o = m->engine()->newStringObject(Value::fromString(that));
+ o->putIndexed(index, value);
}
PropertyAttributes String::query(const Managed *m, String *name)
static Value get(Managed *m, String *name, bool *hasProperty);
static Value getIndexed(Managed *m, uint index, bool *hasProperty);
static void put(Managed *m, ExecutionContext *ctx, String *name, const Value &value);
- static void putIndexed(Managed *m, ExecutionContext *ctx, uint index, const Value &value);
+ static void putIndexed(Managed *m, uint index, const Value &value);
static PropertyAttributes query(const Managed *m, String *name);
static PropertyAttributes queryIndexed(const Managed *m, uint index);
static bool deleteProperty(Managed *, String *);
QV4::ExecutionContext *ctx = engine->current;
try {
if (arrayIndex != UINT_MAX)
- o->putIndexed(ctx, arrayIndex, value.d->getValue(engine));
+ o->putIndexed(arrayIndex, value.d->getValue(engine));
else
o->put(ctx, engine->id_uintMax, value.d->getValue(engine));
} catch (QV4::Exception &e) {
static_cast<QQuickJSContext2DPixelData *>(that)->~QQuickJSContext2DPixelData();
}
static QV4::Value getIndexed(QV4::Managed *m, uint index, bool *hasProperty);
- static void putIndexed(QV4::Managed *m, QV4::ExecutionContext *ctx, uint index, const QV4::Value &value);
+ static void putIndexed(QV4::Managed *m, uint index, const QV4::Value &value);
static QV4::Value proto_get_length(QV4::SimpleCallContext *ctx);
return QV4::Value::undefinedValue();
}
-void QQuickJSContext2DPixelData::putIndexed(QV4::Managed *m, QV4::ExecutionContext *ctx, uint index, const QV4::Value &value)
+void QQuickJSContext2DPixelData::putIndexed(QV4::Managed *m, uint index, const QV4::Value &value)
{
QQuickJSContext2DPixelData *r = m->as<QQuickJSContext2DPixelData>();
if (!r)
- ctx->throwTypeError();
+ m->engine()->current->throwTypeError();
const int v = value.toInt32();
if (r && index < static_cast<quint32>(r->image.width() * r->image.height() * 4) && v >= 0 && v <= 255) {