diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-19 13:17:55 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-22 01:06:20 +0200 |
commit | 78b49cf8361b1462cc94a061916a15f0b98e27e3 (patch) | |
tree | 01ac33be8df5d1cf2801ed34275d22bff7934e62 /src/qml/jsruntime/qv4object_p.h | |
parent | a9bdc91cefabb3729d0240fce4c01a669be09dbf (diff) |
Convert the last methods in qv4object_p.h
Change-Id: I4fda83a0832760c277e629d4e658da718c0bf92b
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4object_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4object_p.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h index 03cc56ac79..ad06ffb552 100644 --- a/src/qml/jsruntime/qv4object_p.h +++ b/src/qml/jsruntime/qv4object_p.h @@ -45,12 +45,12 @@ #include "qv4runtime_p.h" #include "qv4engine_p.h" #include "qv4context_p.h" -#include "qv4sparsearray_p.h" #include "qv4string_p.h" #include "qv4managed_p.h" #include "qv4property_p.h" #include "qv4internalclass_p.h" #include "qv4objectiterator_p.h" +#include "qv4sparsearray_p.h" #include <QtCore/QString> #include <QtCore/QHash> @@ -147,12 +147,14 @@ struct Q_QML_EXPORT Object: Managed { // void put(ExecutionContext *ctx, const QString &name, const ValueRef value); - static ReturnedValue getValue(const Value &thisObject, const Property *p, PropertyAttributes attrs); + static ReturnedValue getValue(const ValueRef thisObject, const Property *p, PropertyAttributes attrs); ReturnedValue getValue(const Property *p, PropertyAttributes attrs) const { - return getValue(Value::fromObject(const_cast<Object *>(this)), p, attrs); + Scope scope(this->engine()); + ScopedValue t(scope, Value::fromObject(const_cast<Object *>(this))); + return getValue(t, p, attrs); } - void putValue(Property *pd, PropertyAttributes attrs, const Value &value); + void putValue(Property *pd, PropertyAttributes attrs, const ValueRef value); void inplaceBinOp(ExecutionContext *, BinOp op, const StringRef name, const ValueRef rhs); void inplaceBinOpValue(ExecutionContext *ctx, BinOp op, const ValueRef index, const ValueRef rhs); @@ -267,7 +269,7 @@ public: SparseArrayNode *sparseArrayEnd() { return sparseArray ? sparseArray->end() : 0; } void arrayConcat(const ArrayObject *other); - void arraySort(ExecutionContext *context, Object *thisObject, const Value &comparefn, uint arrayDataLen); + void arraySort(ExecutionContext *context, ObjectRef thisObject, const ValueRef comparefn, uint arrayDataLen); ReturnedValue arrayIndexOf(Value v, uint fromIndex, uint arrayDataLen, ExecutionContext *ctx, Object *o); void arrayReserve(uint n); @@ -349,14 +351,14 @@ protected: struct BooleanObject: Object { Value value; - BooleanObject(ExecutionEngine *engine, const Value &value): Object(engine->booleanClass), value(value) { type = Type_BooleanObject; } + BooleanObject(ExecutionEngine *engine, const ValueRef value): Object(engine->booleanClass), value(*value) { type = Type_BooleanObject; } protected: BooleanObject(InternalClass *ic): Object(ic), value(Value::fromBoolean(false)) { type = Type_BooleanObject; } }; struct NumberObject: Object { Value value; - NumberObject(ExecutionEngine *engine, const Value &value): Object(engine->numberClass), value(value) { type = Type_NumberObject; } + NumberObject(ExecutionEngine *engine, const ValueRef value): Object(engine->numberClass), value(*value) { type = Type_NumberObject; } protected: NumberObject(InternalClass *ic): Object(ic), value(Value::fromInt32(0)) { type = Type_NumberObject; } }; |