Value result = instance->getIndexed(ctx, len - 1);
- instance->deleteIndexedProperty(ctx, len - 1);
+ instance->deleteIndexedProperty(len - 1);
if (instance->isArrayObject())
instance->setArrayLengthUnchecked(len - 1);
else
if (hiExists)
instance->putIndexed(ctx, lo, hval);
else
- instance->deleteIndexedProperty(ctx, lo);
+ instance->deleteIndexedProperty(lo);
if (loExists)
instance->putIndexed(ctx, hi, lval);
else
- instance->deleteIndexedProperty(ctx, hi);
+ instance->deleteIndexedProperty(hi);
}
return Value::fromObject(instance);
}
if (exists)
instance->putIndexed(ctx, k - 1, v);
else
- instance->deleteIndexedProperty(ctx, k - 1);
+ instance->deleteIndexedProperty(k - 1);
}
- instance->deleteIndexedProperty(ctx, len - 1);
+ instance->deleteIndexedProperty(len - 1);
}
if (instance->isArrayObject())
if (exists)
instance->putIndexed(k + itemCount, v);
else
- instance->deleteIndexedProperty(ctx, k + itemCount);
+ instance->deleteIndexedProperty(k + itemCount);
}
for (uint k = len; k > len - deleteCount + itemCount; --k)
- instance->deleteIndexedProperty(ctx, k - 1);
+ instance->deleteIndexedProperty(k - 1);
} else if (itemCount > deleteCount) {
uint k = len - deleteCount;
while (k > start) {
if (exists)
instance->putIndexed(k + itemCount - 1, v);
else
- instance->deleteIndexedProperty(ctx, k + itemCount - 1);
+ instance->deleteIndexedProperty(k + itemCount - 1);
--k;
}
}
if (exists)
instance->putIndexed(ctx, k + ctx->argumentCount - 1, v);
else
- instance->deleteIndexedProperty(ctx, k + ctx->argumentCount - 1);
+ instance->deleteIndexedProperty(k + ctx->argumentCount - 1);
}
for (uint i = 0; i < ctx->argumentCount; ++i)
instance->putIndexed(ctx, i, ctx->argument(i));
hasWith = true;
WithContext *w = static_cast<WithContext *>(ctx);
if (w->withObject->__hasProperty__(name))
- return w->withObject->deleteProperty(this, name);
+ return w->withObject->deleteProperty(name);
} else if (ctx->type == Type_CatchContext) {
CatchContext *c = static_cast<CatchContext *>(ctx);
if (c->exceptionVarName->isEqualTo(name))
return false;
}
if (c->activation && c->activation->__hasProperty__(name))
- return c->activation->deleteProperty(this, name);
+ return c->activation->deleteProperty(name);
} else if (ctx->type == Type_GlobalContext) {
GlobalContext *g = static_cast<GlobalContext *>(ctx);
if (g->global->__hasProperty__(name))
- return g->global->deleteProperty(this, name);
+ return g->global->deleteProperty(name);
}
}
void (*putIndexed)(Managed *, ExecutionContext *ctx, uint index, const Value &value);
PropertyAttributes (*query)(const Managed *, String *name);
PropertyAttributes (*queryIndexed)(const Managed *, uint index);
- bool (*deleteProperty)(Managed *m, ExecutionContext *ctx, String *name);
- bool (*deleteIndexedProperty)(Managed *m, ExecutionContext *ctx, uint index);
+ bool (*deleteProperty)(Managed *m, String *name);
+ bool (*deleteIndexedProperty)(Managed *m, uint index);
void (*getLookup)(Managed *m, ExecutionContext *ctx, Lookup *l, Value *result);
void (*setLookup)(Managed *m, ExecutionContext *ctx, Lookup *l, const Value &v);
bool (*isEqualTo)(Managed *m, Managed *other);
PropertyAttributes queryIndexed(uint index) const
{ return vtbl->queryIndexed(this, index); }
- bool deleteProperty(ExecutionContext *ctx, String *name)
- { return vtbl->deleteProperty(this, ctx, name); }
- bool deleteIndexedProperty(ExecutionContext *ctx, uint index)
- { return vtbl->deleteIndexedProperty(this, ctx, index); }
+ bool deleteProperty(String *name)
+ { return vtbl->deleteProperty(this, name); }
+ bool deleteIndexedProperty(uint index)
+ { return vtbl->deleteIndexedProperty(this, index); }
void getLookup(ExecutionContext *ctx, Lookup *l, Value *result)
{ vtbl->getLookup(this, ctx, l, result); }
void setLookup(ExecutionContext *ctx, Lookup *l, const Value &v)
return Attr_Invalid;
}
-bool Object::deleteProperty(Managed *m, ExecutionContext *ctx, String *name)
+bool Object::deleteProperty(Managed *m, String *name)
{
- return static_cast<Object *>(m)->internalDeleteProperty(ctx, name);
+ return static_cast<Object *>(m)->internalDeleteProperty(name);
}
-bool Object::deleteIndexedProperty(Managed *m, ExecutionContext *ctx, uint index)
+bool Object::deleteIndexedProperty(Managed *m, uint index)
{
- return static_cast<Object *>(m)->internalDeleteIndexedProperty(ctx, index);
+ return static_cast<Object *>(m)->internalDeleteIndexedProperty(index);
}
void Object::getLookup(Managed *m, ExecutionContext *ctx, Lookup *l, Value *result)
}
// Section 8.12.7
-bool Object::internalDeleteProperty(ExecutionContext *ctx, String *name)
+bool Object::internalDeleteProperty(String *name)
{
uint idx = name->asArrayIndex();
if (idx != UINT_MAX)
- return deleteIndexedProperty(ctx, idx);
+ return deleteIndexedProperty(idx);
- name->makeIdentifier(ctx);
+ name->makeIdentifier(engine()->current);
uint memberIdx = internalClass->find(name);
if (memberIdx != UINT_MAX) {
memmove(memberData + memberIdx, memberData + memberIdx + 1, (internalClass->size - memberIdx)*sizeof(Property));
return true;
}
- if (ctx->strictMode)
- ctx->throwTypeError();
+ if (engine()->current->strictMode)
+ engine()->current->throwTypeError();
return false;
}
return true;
}
-bool Object::internalDeleteIndexedProperty(ExecutionContext *ctx, uint index)
+bool Object::internalDeleteIndexedProperty(uint index)
{
uint pidx = propertyIndexFromArrayIndex(index);
if (pidx == UINT_MAX)
return true;
}
- if (ctx->strictMode)
- ctx->throwTypeError();
+ if (engine()->current->strictMode)
+ engine()->current->throwTypeError();
return false;
}
static void putIndexed(Managed *m, ExecutionContext *ctx, 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, ExecutionContext *ctx, String *name);
- static bool deleteIndexedProperty(Managed *m, ExecutionContext *ctx, uint index);
+ static bool deleteProperty(Managed *m, String *name);
+ static bool deleteIndexedProperty(Managed *m, uint index);
static void getLookup(Managed *m, ExecutionContext *ctx, Lookup *l, Value *result);
static void setLookup(Managed *m, ExecutionContext *ctx, Lookup *l, const Value &v);
static Property *advanceIterator(Managed *m, ObjectIterator *it, String **name, uint *index, PropertyAttributes *attributes);
Value internalGetIndexed(ExecutionContext *ctx, uint index, bool *hasProperty);
void internalPut(ExecutionContext *ctx, String *name, const Value &value);
void internalPutIndexed(ExecutionContext *ctx, uint index, const Value &value);
- bool internalDeleteProperty(ExecutionContext *ctx, String *name);
- bool internalDeleteIndexedProperty(ExecutionContext *ctx, uint index);
+ bool internalDeleteProperty(String *name);
+ bool internalDeleteIndexedProperty(uint index);
friend struct ObjectIterator;
friend struct ObjectPrototype;
return Attr_Invalid;
}
-bool RegExp::deleteProperty(Managed *m, ExecutionContext *ctx, String *name)
+bool RegExp::deleteProperty(Managed *, String *)
{
return false;
}
-bool RegExp::deleteIndexedProperty(Managed *m, ExecutionContext *ctx, uint index)
+bool RegExp::deleteIndexedProperty(Managed *m, uint index)
{
return false;
}
static void putIndexed(Managed *m, ExecutionContext *ctx, 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, ExecutionContext *ctx, String *name);
- static bool deleteIndexedProperty(Managed *m, ExecutionContext *ctx, uint index);
+ static bool deleteProperty(Managed *, String *);
+ static bool deleteIndexedProperty(Managed *m, uint index);
static Property *advanceIterator(Managed *m, ObjectIterator *it, String **name, uint *index, PropertyAttributes *attributes);
private:
if (Object *o = base.asObject()) {
uint n = index.asArrayIndex();
if (n < UINT_MAX) {
- Value res = Value::fromBoolean(o->deleteIndexedProperty(ctx, n));
+ Value res = Value::fromBoolean(o->deleteIndexedProperty(n));
if (result)
*result = res;
return;
void __qmljs_delete_member(ExecutionContext *ctx, Value *result, const Value &base, String *name)
{
Object *obj = base.toObject(ctx);
- Value res = Value::fromBoolean(obj->deleteProperty(ctx, name));
+ Value res = Value::fromBoolean(obj->deleteProperty(name));
if (result)
*result = res;
}
return QV4::Object::advanceIterator(this, it, name, index, attrs);
}
- bool containerDeleteIndexedProperty(QV4::ExecutionContext *ctx, uint index)
+ bool containerDeleteIndexedProperty(uint index)
{
/* Qt containers have int (rather than uint) allowable indexes. */
if (index > INT_MAX)
{ static_cast<QQmlSequence<Container> *>(that)->containerPutIndexed(ctx, 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, QV4::ExecutionContext *ctx, uint index)
- { return static_cast<QQmlSequence<Container> *>(that)->containerDeleteIndexedProperty(ctx, index); }
+ static bool deleteIndexedProperty(QV4::Managed *that, uint index)
+ { return static_cast<QQmlSequence<Container> *>(that)->containerDeleteIndexedProperty(index); }
static bool isEqualTo(Managed *that, Managed *other)
{ return static_cast<QQmlSequence<Container> *>(that)->containerIsEqualTo(other); }
static Property *advanceIterator(Managed *that, ObjectIterator *it, String **name, uint *index, PropertyAttributes *attrs)
return (index < that->_text.length()) ? Attr_NotConfigurable|Attr_NotWritable : Attr_Invalid;
}
-bool String::deleteProperty(Managed *m, ExecutionContext *ctx, String *name)
+bool String::deleteProperty(Managed *, String *)
{
return false;
}
-bool String::deleteIndexedProperty(Managed *m, ExecutionContext *ctx, uint index)
+bool String::deleteIndexedProperty(Managed *m, uint index)
{
return false;
}
static void putIndexed(Managed *m, ExecutionContext *ctx, 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, ExecutionContext *ctx, String *name);
- static bool deleteIndexedProperty(Managed *m, ExecutionContext *ctx, uint index);
+ static bool deleteProperty(Managed *, String *);
+ static bool deleteIndexedProperty(Managed *m, uint index);
static const ManagedVTable static_vtbl;
};
return &tmpProperty;
}
-bool StringObject::deleteIndexedProperty(Managed *m, ExecutionContext *ctx, uint index)
+bool StringObject::deleteIndexedProperty(Managed *m, uint index)
{
StringObject *o = m->asStringObject();
if (!o)
- ctx->throwTypeError();
+ m->engine()->current->throwTypeError();
if (index < o->value.stringValue()->toQString().length()) {
- if (ctx->strictMode)
- ctx->throwTypeError();
+ if (m->engine()->current->strictMode)
+ m->engine()->current->throwTypeError();
return false;
}
return true;
Property *getIndex(uint index) const;
- static bool deleteIndexedProperty(Managed *m, ExecutionContext *ctx, uint index);
+ static bool deleteIndexedProperty(Managed *m, uint index);
protected:
static Property *advanceIterator(Managed *m, ObjectIterator *it, String **name, uint *index, PropertyAttributes *attrs);
ExecutionEngine *engine = d->engine;
String *s = engine->newString(name);
- return o->deleteProperty(engine->current, s);
+ return o->deleteProperty(s);
}
/*!