}
-Value QmlContextWrapper::get(Managed *m, ExecutionContext *ctx, String *name, bool *hasProperty)
+Value QmlContextWrapper::get(Managed *m, String *name, bool *hasProperty)
{
QmlContextWrapper *resource = m->as<QmlContextWrapper>();
+ QV4::ExecutionEngine *v4 = m->engine();
if (!resource)
- ctx->throwTypeError();
+ v4->current->throwTypeError();
if (resource->isNullWrapper)
- return Object::get(m, ctx, name, hasProperty);
+ return Object::get(m, name, hasProperty);
bool hasProp;
- Value result = Object::get(m, ctx, name, &hasProp);
+ Value result = Object::get(m, name, &hasProp);
if (hasProp) {
if (hasProperty)
*hasProperty = hasProp;
ep->captureProperty(&context->idValues[propertyIdx].bindings);
if (hasProperty)
*hasProperty = true;
- return QV4::QObjectWrapper::wrap(ctx->engine, context->idValues[propertyIdx]);
+ return QV4::QObjectWrapper::wrap(v4, context->idValues[propertyIdx]);
} else {
QQmlContextPrivate *cp = context->asQQmlContextPrivate();
// Search scope object
if (scopeObject) {
bool hasProp = false;
- QV4::Value result = QV4::QObjectWrapper::getQmlProperty(ctx, context, scopeObject, name, QV4::QObjectWrapper::CheckRevision, &hasProp);
+ QV4::Value result = QV4::QObjectWrapper::getQmlProperty(v4->current, context, scopeObject, name, QV4::QObjectWrapper::CheckRevision, &hasProp);
if (hasProp) {
if (hasProperty)
*hasProperty = true;
// Search context object
if (context->contextObject) {
bool hasProp = false;
- QV4::Value result = QV4::QObjectWrapper::getQmlProperty(ctx, context, context->contextObject, name, QV4::QObjectWrapper::CheckRevision, &hasProp);
+ QV4::Value result = QV4::QObjectWrapper::getQmlProperty(v4->current, context, context->contextObject, name, QV4::QObjectWrapper::CheckRevision, &hasProp);
if (hasProp) {
if (hasProperty)
*hasProperty = true;
void setReadOnly(bool b) { readOnly = b; }
- static Value get(Managed *m, ExecutionContext *ctx, String *name, bool *hasProperty);
+ static Value get(Managed *m, String *name, bool *hasProperty);
static void put(Managed *m, ExecutionContext *ctx, String *name, const Value &value);
static void destroy(Managed *that);
}
-Value QmlListWrapper::get(Managed *m, ExecutionContext *ctx, String *name, bool *hasProperty)
+Value QmlListWrapper::get(Managed *m, String *name, bool *hasProperty)
{
+ QV4::ExecutionEngine *v4 = m->engine();
QmlListWrapper *w = m->as<QmlListWrapper>();
if (!w)
- ctx->throwTypeError();
+ v4->current->throwTypeError();
- if (name == ctx->engine->id_length && !w->object.isNull()) {
+ if (name == v4->id_length && !w->object.isNull()) {
quint32 count = w->property.count ? w->property.count(&w->property) : 0;
return Value::fromUInt32(count);
}
QVariant toVariant() const;
- static Value get(Managed *m, ExecutionContext *ctx, String *name, bool *hasProperty);
+ 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 Property *advanceIterator(Managed *m, ObjectIterator *it, String **name, uint *index, PropertyAttributes *attributes);
}
-Value QmlTypeWrapper::get(Managed *m, ExecutionContext *ctx, String *name, bool *hasProperty)
+Value QmlTypeWrapper::get(Managed *m, String *name, bool *hasProperty)
{
QmlTypeWrapper *w = m->as<QmlTypeWrapper>();
+ QV4::ExecutionEngine *v4 = m->engine();
if (!w)
- ctx->throwTypeError();
+ v4->current->throwTypeError();
if (hasProperty)
*hasProperty = true;
}
// check for property.
- return QV4::QObjectWrapper::getQmlProperty(ctx, context, qobjectSingleton, name, QV4::QObjectWrapper::IgnoreRevision);
+ return QV4::QObjectWrapper::getQmlProperty(v4->current, context, qobjectSingleton, name, QV4::QObjectWrapper::IgnoreRevision);
} else if (!siinfo->scriptApi(e).isUndefined()) {
QV4::ExecutionEngine *engine = QV8Engine::getV4(v8engine);
// NOTE: if used in a binding, changes will not trigger re-evaluation since non-NOTIFYable.
QV4::Object *o = QJSValuePrivate::get(siinfo->scriptApi(e))->getValue(engine).asObject();
if (o)
- return o->get(engine->current, name);
+ return o->get(name);
}
// Fall through to base implementation
} else if (w->object) {
QObject *ao = qmlAttachedPropertiesObjectById(type->attachedPropertiesId(), object);
if (ao)
- return QV4::QObjectWrapper::getQmlProperty(ctx, context, ao, name, QV4::QObjectWrapper::IgnoreRevision);
+ return QV4::QObjectWrapper::getQmlProperty(v4->current, context, ao, name, QV4::QObjectWrapper::IgnoreRevision);
// Fall through to base implementation
}
if (hasProperty)
*hasProperty = false;
- return Object::get(m, ctx, name, hasProperty);
+ return Object::get(m, name, hasProperty);
}
static QV4::Value create(QV8Engine *, QObject *, QQmlTypeNameCache *, const void *, TypeNameMode = IncludeEnums);
- static Value get(Managed *m, ExecutionContext *ctx, String *name, bool *hasProperty);
+ static Value get(Managed *m, String *name, bool *hasProperty);
static void put(Managed *m, ExecutionContext *ctx, String *name, const Value &value);
static void destroy(Managed *that);
}
}
-Value QmlValueTypeWrapper::get(Managed *m, ExecutionContext *ctx, String *name, bool *hasProperty)
+Value QmlValueTypeWrapper::get(Managed *m, String *name, bool *hasProperty)
{
QmlValueTypeWrapper *r = m->as<QmlValueTypeWrapper>();
+ QV4::ExecutionEngine *v4 = m->engine();
if (!r)
- ctx->throwTypeError();
+ v4->current->throwTypeError();
QHashedV4String propertystring(Value::fromString(name));
}
if (!result)
- return Object::get(m, ctx, name, hasProperty);
+ return Object::get(m, name, hasProperty);
if (result->isFunction()) {
// calling a Q_INVOKABLE function of a value type
- QQmlContextData *qmlContext = QV4::QmlContextWrapper::callingContext(ctx->engine);
- return QV4::QObjectWrapper::getQmlProperty(ctx, qmlContext, r->type, name, QV4::QObjectWrapper::IgnoreRevision);
+ QQmlContextData *qmlContext = QV4::QmlContextWrapper::callingContext(v4);
+ return QV4::QObjectWrapper::getQmlProperty(v4->current, qmlContext, r->type, name, QV4::QObjectWrapper::IgnoreRevision);
}
#define VALUE_TYPE_LOAD(metatype, cpptype, constructor) \
bool isEqual(const QVariant& value);
- static Value get(Managed *m, ExecutionContext *ctx, String *name, bool *hasProperty);
+ static Value get(Managed *m, String *name, bool *hasProperty);
static void put(Managed *m, ExecutionContext *ctx, String *name, const Value &value);
static void destroy(Managed *that);
static bool isEqualTo(Managed *m, Managed *other);
static void destroy(Managed *that) {
that->as<NamedNodeMap>()->~NamedNodeMap();
}
- static Value get(Managed *m, ExecutionContext *ctx, String *name, bool *hasProperty);
+ static Value get(Managed *m, String *name, bool *hasProperty);
static Value getIndexed(Managed *m, uint index, bool *hasProperty);
QList<NodeImpl *> list; // Only used in NamedNodeMap
static void destroy(Managed *that) {
that->as<NodeList>()->~NodeList();
}
- static Value get(Managed *m, ExecutionContext *ctx, String *name, bool *hasProperty);
+ static Value get(Managed *m, String *name, bool *hasProperty);
static Value getIndexed(Managed *m, uint index, bool *hasProperty);
// C++ API
return Value::undefinedValue();
}
-Value NamedNodeMap::get(Managed *m, ExecutionContext *ctx, String *name, bool *hasProperty)
+Value NamedNodeMap::get(Managed *m, String *name, bool *hasProperty)
{
NamedNodeMap *r = m->as<NamedNodeMap>();
+ QV4::ExecutionEngine *v4 = m->engine();
if (!r)
- ctx->throwTypeError();
+ v4->current->throwTypeError();
- name->makeIdentifier(ctx);
- if (name->isEqualTo(ctx->engine->id_length))
+ name->makeIdentifier(v4->current);
+ if (name->isEqualTo(v4->id_length))
return Value::fromInt32(r->list.count());
- QV8Engine *engine = ctx->engine->v8Engine;
+ QV8Engine *engine = v4->v8Engine;
QString str = name->toQString();
for (int ii = 0; ii < r->list.count(); ++ii) {
return Value::undefinedValue();
}
-Value NodeList::get(Managed *m, ExecutionContext *ctx, String *name, bool *hasProperty)
+Value NodeList::get(Managed *m, String *name, bool *hasProperty)
{
+ QV4::ExecutionEngine *v4 = m->engine();
NodeList *r = m->as<NodeList>();
if (!r)
- ctx->throwTypeError();
+ v4->current->throwTypeError();
- name->makeIdentifier(ctx);
+ name->makeIdentifier(v4->current);
- if (name->isEqualTo(ctx->engine->id_length))
+ if (name->isEqualTo(v4->id_length))
return Value::fromInt32(r->d->children.count());
- return Object::get(m, ctx, name, hasProperty);
+ return Object::get(m, name, hasProperty);
}
Value NodeList::create(QV8Engine *engine, NodeImpl *data)
{
if (o->isArrayObject())
return o->arrayLength();
- return o->get(ctx, ctx->engine->id_length).toUInt32();
+ return o->get(ctx->engine->id_length).toUInt32();
}
Value ArrayPrototype::method_isArray(SimpleCallContext *ctx)
Object *o = ctx->thisObject.toObject(ctx);
ArrayObject *result = ctx->engine->newArrayObject();
- uint len = o->get(ctx, ctx->engine->id_length).toUInt32();
+ uint len = o->get(ctx->engine->id_length).toUInt32();
double s = ctx->argument(0).toInteger();
uint start;
if (s < 0)
Object *w = static_cast<WithContext *>(ctx)->withObject;
hasWith = true;
bool hasProperty = false;
- Value v = w->get(ctx, name, &hasProperty);
+ Value v = w->get(name, &hasProperty);
if (hasProperty) {
return v;
}
}
if (c->activation) {
bool hasProperty = false;
- Value v = c->activation->get(c, name, &hasProperty);
+ Value v = c->activation->get(name, &hasProperty);
if (hasProperty)
return v;
}
else if (ctx->type == Type_GlobalContext) {
GlobalContext *g = static_cast<GlobalContext *>(ctx);
bool hasProperty = false;
- Value v = g->global->get(g, name, &hasProperty);
+ Value v = g->global->get(name, &hasProperty);
if (hasProperty)
return v;
}
Object *w = static_cast<WithContext *>(ctx)->withObject;
hasWith = true;
bool hasProperty = false;
- Value v = w->get(ctx, name, &hasProperty);
+ Value v = w->get(name, &hasProperty);
if (hasProperty) {
return v;
}
}
if (c->activation) {
bool hasProperty = false;
- Value v = c->activation->get(c, name, &hasProperty);
+ Value v = c->activation->get(name, &hasProperty);
if (hasProperty)
return v;
}
else if (ctx->type == Type_GlobalContext) {
GlobalContext *g = static_cast<GlobalContext *>(ctx);
bool hasProperty = false;
- Value v = g->global->get(g, name, &hasProperty);
+ Value v = g->global->get(name, &hasProperty);
if (hasProperty)
return v;
}
Object *w = static_cast<WithContext *>(ctx)->withObject;
hasWith = true;
bool hasProperty = false;
- Value v = w->get(ctx, name, &hasProperty);
+ Value v = w->get(name, &hasProperty);
if (hasProperty) {
*base = w;
return v;
}
if (c->activation) {
bool hasProperty = false;
- Value v = c->activation->get(c, name, &hasProperty);
+ Value v = c->activation->get(name, &hasProperty);
if (hasProperty) {
*base = c->activation;
return v;
else if (ctx->type == Type_GlobalContext) {
GlobalContext *g = static_cast<GlobalContext *>(ctx);
bool hasProperty = false;
- Value v = g->global->get(g, name, &hasProperty);
+ Value v = g->global->get(name, &hasProperty);
if (hasProperty)
return v;
}
if (tv.isNumber() && !std::isfinite(tv.toNumber()))
return Value::nullValue();
- FunctionObject *toIso = O.objectValue()->get(ctx, ctx->engine->newString(QStringLiteral("toISOString"))).asFunctionObject();
+ FunctionObject *toIso = O.objectValue()->get(ctx->engine->newString(QStringLiteral("toISOString"))).asFunctionObject();
if (!toIso)
ctx->throwTypeError();
if (!o)
ctx->throwTypeError();
- Value name = o->get(ctx, ctx->engine->newString(QString::fromLatin1("name")));
+ Value name = o->get(ctx->engine->newString(QString::fromLatin1("name")));
QString qname;
if (name.isUndefined())
qname = QString::fromLatin1("Error");
else
qname = __qmljs_to_string(name, ctx).stringValue()->toQString();
- Value message = o->get(ctx, ctx->engine->newString(QString::fromLatin1("message")));
+ Value message = o->get(ctx->engine->newString(QString::fromLatin1("message")));
QString qmessage;
if (!message.isUndefined())
qmessage = __qmljs_to_string(message, ctx).stringValue()->toQString();
return false;
ExecutionContext *ctx = f->engine()->current;
- Object *o = f->get(ctx, ctx->engine->id_prototype).asObject();
+ Object *o = f->get(ctx->engine->id_prototype).asObject();
if (!o)
ctx->throwTypeError();
FunctionObject *f = static_cast<FunctionObject *>(that);
Object *obj = context->engine->newObject();
- Value proto = f->get(context, context->engine->id_prototype);
+ Value proto = f->get(context->engine->id_prototype);
if (proto.isObject())
obj->prototype = proto.objectValue();
return Value::fromObject(obj);
QVector<Value> args;
if (Object *arr = arg.asObject()) {
- quint32 len = arr->get(ctx, ctx->engine->id_length).toUInt32();
+ quint32 len = arr->get(ctx->engine->id_length).toUInt32();
for (quint32 i = 0; i < len; ++i) {
Value a = arr->getIndexed(i);
args.append(a);
ScriptFunction *f = static_cast<ScriptFunction *>(that);
assert(f->function->code);
Object *obj = context->engine->newObject();
- Value proto = f->get(context, context->engine->id_prototype);
+ Value proto = f->get(context->engine->id_prototype);
if (proto.isObject())
obj->prototype = proto.objectValue();
, boundArgs(boundArgs)
{
vtbl = &static_vtbl;
- int len = target->get(scope, scope->engine->id_length).toUInt32();
+ int len = target->get(scope->engine->id_length).toUInt32();
len -= boundArgs.size();
if (len < 0)
len = 0;
QString result;
if (Object *o = value.asObject()) {
- FunctionObject *toJSON = o->get(ctx, ctx->engine->newString(QStringLiteral("toJSON"))).asFunctionObject();
+ FunctionObject *toJSON = o->get(ctx->engine->newString(QStringLiteral("toJSON"))).asFunctionObject();
if (toJSON) {
Value arg = Value::fromString(ctx, key);
value = toJSON->call(ctx, value, &arg, 1);
} else {
for (int i = 0; i < propertyList.size(); ++i) {
bool exists;
- Value v = o->get(ctx, propertyList.at(i), &exists);
+ Value v = o->get(propertyList.at(i), &exists);
if (!exists)
continue;
QString member = makeMember(propertyList.at(i)->toQString(), v);
Value res;
if (Managed *m = object.asManaged()) {
- res = m->get(m->engine()->current, l->name);
+ res = m->get(l->name);
} else {
ExecutionContext *ctx = l->name->engine()->current;
Object *o = __qmljs_convert_to_object(ctx, object);
- res = o->get(ctx, l->name);
+ res = o->get(l->name);
}
if (result)
*result = res;
return false;
}
-Value Managed::get(ExecutionContext *ctx, String *name, bool *hasProperty)
+Value Managed::get(String *name, bool *hasProperty)
{
- return vtbl->get(this, ctx, name, hasProperty);
+ return vtbl->get(this, name, hasProperty);
}
Value Managed::getIndexed(uint index, bool *hasProperty)
void (*destroy)(Managed *);
void (*collectDeletables)(Managed *, GCDeletable **deletable);
bool (*hasInstance)(Managed *, const Value &value);
- Value (*get)(Managed *, ExecutionContext *ctx, String *name, bool *hasProperty);
+ 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);
}
Value construct(ExecutionContext *context, Value *args, int argc);
Value call(ExecutionContext *context, const Value &thisObject, Value *args, int argc);
- Value get(ExecutionContext *ctx, String *name, bool *hasProperty = 0);
+ Value get(String *name, bool *hasProperty = 0);
Value getIndexed(uint index, bool *hasProperty = 0);
void put(ExecutionContext *ctx, String *name, const Value &value)
{ vtbl->put(this, ctx, name, value); }
void Object::inplaceBinOp(ExecutionContext *ctx, BinOp op, String *name, const Value &rhs)
{
- Value v = get(ctx, name);
+ Value v = get(name);
Value result;
op(ctx, &result, v, rhs);
put(ctx, name, result);
return !query(name).isEmpty();
}
-Value Object::get(Managed *m, ExecutionContext *ctx, String *name, bool *hasProperty)
+Value Object::get(Managed *m, String *name, bool *hasProperty)
{
- return static_cast<Object *>(m)->internalGet(ctx, name, hasProperty);
+ return static_cast<Object *>(m)->internalGet(name, hasProperty);
}
Value Object::getIndexed(Managed *m, uint index, bool *hasProperty)
}
// Section 8.12.3
-Value Object::internalGet(ExecutionContext *ctx, String *name, bool *hasProperty)
+Value Object::internalGet(String *name, bool *hasProperty)
{
uint idx = name->asArrayIndex();
if (idx != UINT_MAX)
return getIndexed(idx, hasProperty);
- name->makeIdentifier(ctx);
+ name->makeIdentifier(engine()->current);
Object *o = this;
while (o) {
if (idx < UINT_MAX) {
if (hasProperty)
*hasProperty = true;
- return getValue(ctx, o->memberData + idx, o->internalClass->propertyData.at(idx));
+ return getValue(engine()->current, o->memberData + idx, o->internalClass->propertyData.at(idx));
}
o = o->prototype;
void arrayReserve(uint n);
void ensureArrayAttributes();
- inline Value get(String *name)
- { return vtbl->get(this, engine()->current, name, 0); }
+ inline Value get(String *name, bool *hasProperty = 0)
+ { return vtbl->get(this, name, hasProperty); }
inline Value getIndexed(uint idx, bool *hasProperty = 0)
{ return vtbl->getIndexed(this, idx, hasProperty); }
inline void put(String *name, const Value &v)
static const ManagedVTable static_vtbl;
static void destroy(Managed *that);
static void markObjects(Managed *that);
- static Value get(Managed *m, ExecutionContext *ctx, String *name, bool *hasProperty);
+ 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);
private:
- Value internalGet(ExecutionContext *ctx, String *name, bool *hasProperty);
+ 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);
ObjectCtor *ctor = static_cast<ObjectCtor *>(that);
if (!argc || args[0].isUndefined() || args[0].isNull()) {
Object *obj = ctx->engine->newObject();
- Value proto = ctor->get(ctx, ctx->engine->id_prototype);
+ Value proto = ctor->get(ctx->engine->id_prototype);
if (proto.isObject())
obj->prototype = proto.objectValue();
return Value::fromObject(obj);
Value ObjectPrototype::method_toLocaleString(SimpleCallContext *ctx)
{
Object *o = ctx->thisObject.toObject(ctx);
- Value ts = o->get(ctx, ctx->engine->newString(QStringLiteral("toString")));
+ Value ts = o->get(ctx->engine->newString(QStringLiteral("toString")));
FunctionObject *f = ts.asFunctionObject();
if (!f)
ctx->throwTypeError();
desc->setSetter(0);
if (o->__hasProperty__(ctx->engine->id_enumerable))
- attrs->setEnumerable(o->get(ctx, ctx->engine->id_enumerable).toBoolean());
+ attrs->setEnumerable(o->get(ctx->engine->id_enumerable).toBoolean());
if (o->__hasProperty__(ctx->engine->id_configurable))
- attrs->setConfigurable(o->get(ctx, ctx->engine->id_configurable).toBoolean());
+ attrs->setConfigurable(o->get(ctx->engine->id_configurable).toBoolean());
if (o->__hasProperty__(ctx->engine->id_get)) {
- Value get = o->get(ctx, ctx->engine->id_get);
+ Value get = o->get(ctx->engine->id_get);
FunctionObject *f = get.asFunctionObject();
if (f) {
desc->setGetter(f);
}
if (o->__hasProperty__(ctx->engine->id_set)) {
- Value set = o->get(ctx, ctx->engine->id_set);
+ Value set = o->get(ctx->engine->id_set);
FunctionObject *f = set.asFunctionObject();
if (f) {
desc->setSetter(f);
if (o->__hasProperty__(ctx->engine->id_writable)) {
if (attrs->isAccessor())
ctx->throwTypeError();
- attrs->setWritable(o->get(ctx, ctx->engine->id_writable).toBoolean());
+ attrs->setWritable(o->get(ctx->engine->id_writable).toBoolean());
// writable forces it to be a data descriptor
desc->value = Value::undefinedValue();
}
if (o->__hasProperty__(ctx->engine->id_value)) {
if (attrs->isAccessor())
ctx->throwTypeError();
- desc->value = o->get(ctx, ctx->engine->id_value);
+ desc->value = o->get(ctx->engine->id_value);
attrs->setType(PropertyAttributes::Data);
}
}
}
}
- return QV4::Object::get(this, ctx, name, hasProperty);
+ return QV4::Object::get(this, name, hasProperty);
}
QQmlData::flushPendingBinding(m_object, result->coreIndex);
return Value::fromObject(new (engine->memoryManager) QV4::QObjectWrapper(engine, object));
}
-QV4::Value QObjectWrapper::get(Managed *m, ExecutionContext *ctx, String *name, bool *hasProperty)
+QV4::Value QObjectWrapper::get(Managed *m, String *name, bool *hasProperty)
{
QObjectWrapper *that = static_cast<QObjectWrapper*>(m);
- QQmlContextData *qmlContext = QV4::QmlContextWrapper::callingContext(ctx->engine);
- return that->getQmlProperty(ctx, qmlContext, name, IgnoreRevision, hasProperty, /*includeImports*/ true);
+ ExecutionEngine *v4 = m->engine();
+ QQmlContextData *qmlContext = QV4::QmlContextWrapper::callingContext(v4);
+ return that->getQmlProperty(v4->current, qmlContext, name, IgnoreRevision, hasProperty, /*includeImports*/ true);
}
void QObjectWrapper::put(Managed *m, ExecutionContext *ctx, String *name, const Value &value)
String *m_destroy;
String *m_toString;
- static Value get(Managed *m, ExecutionContext *ctx, String *name, bool *hasProperty);
+ static Value get(Managed *m, String *name, bool *hasProperty);
static void put(Managed *m, ExecutionContext *ctx, String *name, const Value &value);
static PropertyAttributes query(const Managed *, String *name);
static Property *advanceIterator(Managed *m, ObjectIterator *it, String **name, uint *index, PropertyAttributes *attributes);
{
}
-Value RegExp::get(Managed *m, ExecutionContext *ctx, String *name, bool *hasProperty)
+Value RegExp::get(Managed *m, String *name, bool *hasProperty)
{
return Value::undefinedValue();
}
protected:
static void destroy(Managed *that);
static void markObjects(Managed *that);
- static Value get(Managed *m, ExecutionContext *ctx, String *name, bool *hasProperty);
+ 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);
ExecutionContext *ctx = engine->current;
- Value conv = object->get(ctx, meth1);
+ Value conv = object->get(meth1);
if (FunctionObject *o = conv.asFunctionObject()) {
Value r = o->call(ctx, Value::fromObject(object), 0, 0);
if (r.isPrimitive())
return r;
}
- conv = object->get(ctx, meth2);
+ conv = object->get(meth2);
if (FunctionObject *o = conv.asFunctionObject()) {
Value r = o->call(ctx, Value::fromObject(object), 0, 0);
if (r.isPrimitive())
}
String *name = index.toString(ctx);
- Value res = o->get(ctx, name);
+ Value res = o->get(name);
if (result)
*result = res;
}
Value res;
Managed *m = object.asManaged();
if (m) {
- res = m->get(ctx, name);
+ res = m->get(name);
} else {
if (object.isNull() || object.isUndefined()) {
QString message = QStringLiteral("Cannot read property '%1' of %2").arg(name->toQString()).arg(object.toQString());
}
m = __qmljs_convert_to_object(ctx, object);
- res = m->get(ctx, name);
+ res = m->get(name);
}
if (result)
*result = res;
thisObject = Value::fromObject(static_cast<Object *>(baseObject));
}
- Value func = baseObject->get(context, name);
+ Value func = baseObject->get(name);
FunctionObject *o = func.asFunctionObject();
if (!o) {
QString error = QString("Property '%1' of object %2 is not a function").arg(name->toQString(), thisObject.toQString());
Object *baseObject = that.toObject(context);
Value thisObject = Value::fromObject(baseObject);
- Value func = baseObject->get(context, index.toString(context));
+ Value func = baseObject->get(index.toString(context));
Object *o = func.asObject();
if (!o)
context->throwTypeError();
{
Object *thisObject = base.toObject(context);
- Value func = thisObject->get(context, name);
+ Value func = thisObject->get(name);
if (Object *f = func.asObject()) {
Value res = f->construct(context, args, argc);
if (result)
{
Object *obj = base.toObject(context);
Value res;
- __qmljs_builtin_typeof(context, &res, obj->get(context, name));
+ __qmljs_builtin_typeof(context, &res, obj->get(name));
if (result)
*result = res;
}
String *name = index.toString(context);
Object *obj = base.toObject(context);
Value res;
- __qmljs_builtin_typeof(context, &res, obj->get(context, name));
+ __qmljs_builtin_typeof(context, &res, obj->get(name));
if (result)
*result = res;
}
{
Object *o = base.toObject(context);
- Value v = o->get(context, name);
+ Value v = o->get(name);
if (v.isInteger() && v.integerValue() < INT_MAX) {
if (result)
{
Object *o = base.toObject(context);
- Value v = o->get(context, name);
+ Value v = o->get(name);
if (v.isInteger() && v.integerValue() > INT_MIN) {
if (result)
static_cast<String*>(that)->~String();
}
-Value String::get(Managed *m, ExecutionContext *ctx, String *name, bool *hasProperty)
+Value String::get(Managed *m, String *name, bool *hasProperty)
{
String *that = static_cast<String *>(m);
- if (name == ctx->engine->id_length) {
+ ExecutionEngine *v4 = m->engine();
+ if (name == v4->id_length) {
if (hasProperty)
*hasProperty = true;
return Value::fromInt32(that->_text.length());
}
PropertyAttributes attrs;
- Property *pd = ctx->engine->stringPrototype->__getPropertyDescriptor__(name, &attrs);
+ Property *pd = v4->stringPrototype->__getPropertyDescriptor__(name, &attrs);
if (!pd || attrs.isGeneric()) {
if (hasProperty)
*hasProperty = false;
}
if (hasProperty)
*hasProperty = true;
- return ctx->engine->stringPrototype->getValue(Value::fromString(that), ctx, pd, attrs);
+ return v4->stringPrototype->getValue(Value::fromString(that), v4->current, pd, attrs);
}
Value String::getIndexed(Managed *m, uint index, bool *hasProperty)
protected:
static void destroy(Managed *);
- static Value get(Managed *m, ExecutionContext *ctx, String *name, bool *hasProperty);
+ 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);
bool global = rx->global;
// ### use the standard builtin function, not the one that might be redefined in the proto
- FunctionObject *exec = context->engine->regExpPrototype->get(context, context->engine->newString(QStringLiteral("exec")), 0).asFunctionObject();
+ FunctionObject *exec = context->engine->regExpPrototype->get(context->engine->newString(QStringLiteral("exec")), 0).asFunctionObject();
Value arg = Value::fromString(s);
if (!global)
if (result.isNull())
break;
assert(result.isObject());
- double thisIndex = rx->get(context, lastIndex, 0).toInteger();
+ double thisIndex = rx->get(lastIndex, 0).toInteger();
if (previousLastIndex == thisIndex) {
previousLastIndex = thisIndex + 1;
rx->put(context, lastIndex, Value::fromDouble(previousLastIndex));
Value Value::property(ExecutionContext *ctx, String *name) const
{
- return isObject() ? objectValue()->get(ctx, name) : undefinedValue();
+ return isObject() ? objectValue()->get(name) : undefinedValue();
}
s->makeIdentifier(engine->current);
QV4::ExecutionContext *ctx = engine->current;
try {
- QV4::Value v = o->get(ctx, s);
+ QV4::Value v = o->get(s);
return new QJSValuePrivate(engine, v);
} catch (QV4::Exception &e) {
e.accept(ctx);
ExecutionEngine *engine = d->engine;
QV4::ExecutionContext *ctx = engine->current;
try {
- QV4::Value v = arrayIndex == UINT_MAX ? o->get(ctx, engine->id_uintMax) : o->getIndexed(arrayIndex);
+ QV4::Value v = arrayIndex == UINT_MAX ? o->get(engine->id_uintMax) : o->getIndexed(arrayIndex);
return new QJSValuePrivate(engine, v);
} catch (QV4::Exception &e) {
e.accept(ctx);
return QV4::Value::fromObject(object);
}
- static QV4::Value get(QV4::Managed *m, QV4::ExecutionContext *ctx, QV4::String *name, bool *hasProperty)
+ static QV4::Value get(QV4::Managed *m, QV4::String *name, bool *hasProperty)
{
QQmlDelegateModelGroupChangeArray *array = m->as<QQmlDelegateModelGroupChangeArray>();
if (!array)
- ctx->throwTypeError();
+ m->engine()->current->throwTypeError();
- if (name == ctx->engine->id_length) {
+ if (name == m->engine()->id_length) {
if (hasProperty)
*hasProperty = true;
return QV4::Value::fromInt32(array->count());
}
- return Object::get(m, ctx, name, hasProperty);
+ return Object::get(m, name, hasProperty);
}
static void destroy(Managed *that) {
QQmlDelegateModelGroupChangeArray *array = that->as<QQmlDelegateModelGroupChangeArray>();