diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-06-22 00:52:47 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2013-06-22 22:02:54 +0200 |
commit | ac4da27f7e53fe394a7f4365aadc9c4caefca864 (patch) | |
tree | 50dde712f42bcdc1d236c075329849ee0c809e5d /src | |
parent | 4171e1ed54b78e20ba3b7f5886c7f9dd87a93df2 (diff) |
Remove context argument from Object::get/putValue
Change-Id: I981b95e30b7761574ddd7891b5dfc24a0136af7f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/qml/qqmlcontextwrapper.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4arrayobject.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4debugging.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4lookup.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4object.cpp | 28 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4object_p.h | 8 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4objectiterator.cpp | 4 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4objectproto.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4runtime.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/v4/qv4string.cpp | 4 | ||||
-rw-r--r-- | src/qml/qml/v8/qjsvalueiterator.cpp | 2 |
11 files changed, 29 insertions, 29 deletions
diff --git a/src/qml/qml/qqmlcontextwrapper.cpp b/src/qml/qml/qqmlcontextwrapper.cpp index bae2e03825..9ceb460dc3 100644 --- a/src/qml/qml/qqmlcontextwrapper.cpp +++ b/src/qml/qml/qqmlcontextwrapper.cpp @@ -283,7 +283,7 @@ void QmlContextWrapper::put(Managed *m, String *name, const Value &value) PropertyAttributes attrs; Property *pd = wrapper->__getOwnProperty__(name, &attrs); if (pd) { - wrapper->putValue(v4->current, pd, attrs, value); + wrapper->putValue(pd, attrs, value); return; } diff --git a/src/qml/qml/v4/qv4arrayobject.cpp b/src/qml/qml/v4/qv4arrayobject.cpp index 26ee41d7f3..4734fbcb12 100644 --- a/src/qml/qml/v4/qv4arrayobject.cpp +++ b/src/qml/qml/v4/qv4arrayobject.cpp @@ -340,7 +340,7 @@ Value ArrayPrototype::method_shift(SimpleCallContext *ctx) if (pidx < UINT_MAX && (!instance->arrayAttributes || !instance->arrayAttributes[0].isGeneric())) front = instance->arrayData + pidx; - Value result = front ? instance->getValue(ctx, front, instance->arrayAttributes ? instance->arrayAttributes[pidx] : Attr_Data) : Value::undefinedValue(); + Value result = front ? instance->getValue(front, instance->arrayAttributes ? instance->arrayAttributes[pidx] : Attr_Data) : Value::undefinedValue(); bool protoHasArray = false; Object *p = instance; diff --git a/src/qml/qml/v4/qv4debugging.cpp b/src/qml/qml/v4/qv4debugging.cpp index b68f3875de..32beec7de5 100644 --- a/src/qml/qml/v4/qv4debugging.cpp +++ b/src/qml/qml/v4/qv4debugging.cpp @@ -296,7 +296,7 @@ static void realDumpValue(QV4::Value v, QV4::ExecutionContext *ctx, std::string cout << prefix << "\t\"" << qPrintable(name.stringValue()->toQString()) << "\"" << endl; PropertyAttributes attrs; Property *d = o->__getOwnProperty__(name.stringValue(), &attrs); - Value pval = o->getValue(ctx, d, attrs); + Value pval = o->getValue(d, attrs); cout << prefix << "\tvalue:" << endl; realDumpValue(pval, ctx, prefix + "\t"); } diff --git a/src/qml/qml/v4/qv4lookup.cpp b/src/qml/qml/v4/qv4lookup.cpp index b462777969..305d1ea44a 100644 --- a/src/qml/qml/v4/qv4lookup.cpp +++ b/src/qml/qml/v4/qv4lookup.cpp @@ -238,7 +238,7 @@ void Lookup::globalGetterGeneric(Lookup *l, ExecutionContext *ctx, Value *result l->globalGetter = globalGetterAccessor1; else if (l->level == 2) l->globalGetter = globalGetterAccessor2; - Value res = o->getValue(ctx, p, attrs); + Value res = o->getValue(p, attrs); if (result) *result = res; return; diff --git a/src/qml/qml/v4/qv4object.cpp b/src/qml/qml/v4/qv4object.cpp index 639cb4f9af..967dcb2afb 100644 --- a/src/qml/qml/v4/qv4object.cpp +++ b/src/qml/qml/v4/qv4object.cpp @@ -131,7 +131,7 @@ void Object::put(ExecutionContext *ctx, const QString &name, const Value &value) put(ctx->engine->newString(name), value); } -Value Object::getValue(const Value &thisObject, ExecutionContext *ctx, const Property *p, PropertyAttributes attrs) +Value Object::getValue(const Value &thisObject, const Property *p, PropertyAttributes attrs) { if (!attrs.isAccessor()) return p->value; @@ -139,16 +139,16 @@ Value Object::getValue(const Value &thisObject, ExecutionContext *ctx, const Pro if (!getter) return Value::undefinedValue(); - return getter->call(ctx, thisObject, 0, 0); + return getter->call(getter->engine()->current, thisObject, 0, 0); } -void Object::putValue(ExecutionContext *ctx, Property *pd, PropertyAttributes attrs, const Value &value) +void Object::putValue(Property *pd, PropertyAttributes attrs, const Value &value) { if (attrs.isAccessor()) { if (pd->set) { Value args[1]; args[0] = value; - pd->set->call(ctx, Value::fromObject(this), args, 1); + pd->set->call(engine()->current, Value::fromObject(this), args, 1); return; } goto reject; @@ -161,8 +161,8 @@ void Object::putValue(ExecutionContext *ctx, Property *pd, PropertyAttributes at return; reject: - if (ctx->strictMode) - ctx->throwTypeError(); + if (engine()->current->strictMode) + engine()->current->throwTypeError(); } @@ -486,7 +486,7 @@ void Object::getLookup(Managed *m, Lookup *l, Value *result) l->getter = Lookup::getterAccessor2; if (result) *result = p->value; - Value res = o->getValue(o->engine()->current, p, attrs); + Value res = o->getValue(p, attrs); if (result) *result = res; return; @@ -511,7 +511,7 @@ void Object::setLookup(Managed *m, Lookup *l, const Value &value) } if (idx != UINT_MAX) { - o->putValue(o->engine()->current, o->memberData + idx, o->internalClass->propertyData[idx], value); + o->putValue(o->memberData + idx, o->internalClass->propertyData[idx], value); return; } } @@ -596,7 +596,7 @@ Value Object::internalGet(String *name, bool *hasProperty) if (idx < UINT_MAX) { if (hasProperty) *hasProperty = true; - return getValue(engine()->current, o->memberData + idx, o->internalClass->propertyData.at(idx)); + return getValue(o->memberData + idx, o->internalClass->propertyData.at(idx)); } o = o->prototype; @@ -635,7 +635,7 @@ Value Object::internalGetIndexed(uint index, bool *hasProperty) if (pd) { if (hasProperty) *hasProperty = true; - return getValue(engine()->current, pd, attrs); + return getValue(pd, attrs); } if (hasProperty) @@ -1060,7 +1060,7 @@ Value Object::arrayIndexOf(Value v, uint fromIndex, uint endIndex, ExecutionCont } } else if (sparseArray) { for (SparseArrayNode *n = sparseArray->lowerBound(fromIndex); n != sparseArray->end() && n->key() < endIndex; n = n->nextNode()) { - Value value = o->getValue(ctx, arrayData + n->value, arrayAttributes ? arrayAttributes[n->value] : Attr_Data); + Value value = o->getValue(arrayData + n->value, arrayAttributes ? arrayAttributes[n->value] : Attr_Data); if (__qmljs_strict_equal(value, v)) return Value::fromDouble(n->key()); } @@ -1072,7 +1072,7 @@ Value Object::arrayIndexOf(Value v, uint fromIndex, uint endIndex, ExecutionCont pd += fromIndex; while (pd < end) { if (!arrayAttributes || !arrayAttributes[pd - arrayData].isGeneric()) { - Value value = o->getValue(ctx, pd, arrayAttributes ? arrayAttributes[pd - arrayData] : Attr_Data); + Value value = o->getValue(pd, arrayAttributes ? arrayAttributes[pd - arrayData] : Attr_Data); if (__qmljs_strict_equal(value, v)) return Value::fromDouble(pd - arrayData); } @@ -1154,11 +1154,11 @@ void Object::arraySort(ExecutionContext *context, Object *thisObject, const Valu while (--len > i) if (!arrayAttributes[len].isGeneric()) break; - arrayData[i].value = getValue(context, arrayData + len, arrayAttributes[len]); + arrayData[i].value = getValue(arrayData + len, arrayAttributes[len]); arrayAttributes[i] = Attr_Data; arrayAttributes[len].clear(); } else if (arrayAttributes[i].isAccessor()) { - arrayData[i].value = getValue(context, arrayData + i, arrayAttributes[i]); + arrayData[i].value = getValue(arrayData + i, arrayAttributes[i]); arrayAttributes[i] = Attr_Data; } } diff --git a/src/qml/qml/v4/qv4object_p.h b/src/qml/qml/v4/qv4object_p.h index dcdeca1611..aeef708278 100644 --- a/src/qml/qml/v4/qv4object_p.h +++ b/src/qml/qml/v4/qv4object_p.h @@ -155,12 +155,12 @@ struct Q_QML_EXPORT Object: Managed { // void put(ExecutionContext *ctx, const QString &name, const Value &value); - static Value getValue(const Value &thisObject, ExecutionContext *ctx, const Property *p, PropertyAttributes attrs); - Value getValue(ExecutionContext *ctx, const Property *p, PropertyAttributes attrs) const { - return getValue(Value::fromObject(const_cast<Object *>(this)), ctx, p, attrs); + static Value getValue(const Value &thisObject, const Property *p, PropertyAttributes attrs); + Value getValue(const Property *p, PropertyAttributes attrs) const { + return getValue(Value::fromObject(const_cast<Object *>(this)), p, attrs); } - void putValue(ExecutionContext *ctx, Property *pd, PropertyAttributes attrs, const Value &value); + void putValue(Property *pd, PropertyAttributes attrs, const Value &value); void inplaceBinOp(ExecutionContext *ctx, BinOp op, String *name, const Value &rhs); void inplaceBinOp(ExecutionContext *ctx, BinOp op, const Value &index, const Value &rhs); diff --git a/src/qml/qml/v4/qv4objectiterator.cpp b/src/qml/qml/v4/qv4objectiterator.cpp index 984d4708c7..cc3319edf8 100644 --- a/src/qml/qml/v4/qv4objectiterator.cpp +++ b/src/qml/qml/v4/qv4objectiterator.cpp @@ -102,7 +102,7 @@ Value ObjectIterator::nextPropertyName(Value *value) return Value::nullValue(); if (value) - *value = object->getValue(object->engine()->current, p, attrs); + *value = object->getValue(p, attrs); if (name) return Value::fromString(name); @@ -120,7 +120,7 @@ Value ObjectIterator::nextPropertyNameAsString(Value *value) return Value::nullValue(); if (value) - *value = object->getValue(object->engine()->current, p, attrs); + *value = object->getValue(p, attrs); if (name) return Value::fromString(name); diff --git a/src/qml/qml/v4/qv4objectproto.cpp b/src/qml/qml/v4/qv4objectproto.cpp index 517d73390b..1d6eda448d 100644 --- a/src/qml/qml/v4/qv4objectproto.cpp +++ b/src/qml/qml/v4/qv4objectproto.cpp @@ -220,7 +220,7 @@ Value ObjectPrototype::method_defineProperties(SimpleCallContext *ctx) break; Property n; PropertyAttributes nattrs; - toPropertyDescriptor(ctx, o->getValue(ctx, pd, attrs), &n, &nattrs); + toPropertyDescriptor(ctx, o->getValue(pd, attrs), &n, &nattrs); bool ok; if (name) ok = O.objectValue()->__defineOwnProperty__(ctx, name, n, nattrs); diff --git a/src/qml/qml/v4/qv4runtime.cpp b/src/qml/qml/v4/qv4runtime.cpp index 2cff28b3c0..774abb693c 100644 --- a/src/qml/qml/v4/qv4runtime.cpp +++ b/src/qml/qml/v4/qv4runtime.cpp @@ -846,7 +846,7 @@ void __qmljs_call_property_lookup(ExecutionContext *context, Value *result, cons Property *p = l->lookup(baseObject, &attrs); if (!p) context->throwTypeError(); - Value func = attrs.isData() ? p->value : baseObject->getValue(context, p, attrs); + Value func = attrs.isData() ? p->value : baseObject->getValue(p, attrs); FunctionObject *o = func.asFunctionObject(); if (!o) context->throwTypeError(); diff --git a/src/qml/qml/v4/qv4string.cpp b/src/qml/qml/v4/qv4string.cpp index 8807326e24..f96876dc83 100644 --- a/src/qml/qml/v4/qv4string.cpp +++ b/src/qml/qml/v4/qv4string.cpp @@ -120,7 +120,7 @@ Value String::get(Managed *m, String *name, bool *hasProperty) } if (hasProperty) *hasProperty = true; - return v4->stringPrototype->getValue(Value::fromString(that), v4->current, pd, attrs); + return v4->stringPrototype->getValue(Value::fromString(that), pd, attrs); } Value String::getIndexed(Managed *m, uint index, bool *hasProperty) @@ -141,7 +141,7 @@ Value String::getIndexed(Managed *m, uint index, bool *hasProperty) } if (hasProperty) *hasProperty = true; - return engine->stringPrototype->getValue(Value::fromString(that), engine->current, pd, attrs); + return engine->stringPrototype->getValue(Value::fromString(that), pd, attrs); } void String::put(Managed *m, String *name, const Value &value) diff --git a/src/qml/qml/v8/qjsvalueiterator.cpp b/src/qml/qml/v8/qjsvalueiterator.cpp index 6f09bc793c..a6fba112c9 100644 --- a/src/qml/qml/v8/qjsvalueiterator.cpp +++ b/src/qml/qml/v8/qjsvalueiterator.cpp @@ -180,7 +180,7 @@ QJSValue QJSValueIterator::value() const QV4::ExecutionEngine *engine = o->internalClass->engine; QV4::ExecutionContext *ctx = engine->current; try { - QV4::Value v = o->getValue(ctx, d_ptr->currentValue, d_ptr->currentAttributes); + QV4::Value v = o->getValue(d_ptr->currentValue, d_ptr->currentAttributes); return new QJSValuePrivate(engine, v); } catch (QV4::Exception &e) { e.accept(ctx); |