diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-01-15 21:54:12 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2015-01-23 12:30:38 +0100 |
commit | ef6b4938b9ec309d5faf0c966cb2b58f3de2ca77 (patch) | |
tree | 3d946ad66defb1ec5c60a50e16b6e7883ec33862 /src/qml/jsruntime/qv4object_p.h | |
parent | 3dbf4e9a6979802fff55e2f5e6aa54a14280e128 (diff) |
Cleanups
Simplify some code in BooleanObject
Simplify access to call arguments and thisObject
Change-Id: I2f8e844019bc587385608beb02f05b15f827535c
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, 8 insertions, 8 deletions
diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h index 1c36f179b2..4e88cd785e 100644 --- a/src/qml/jsruntime/qv4object_p.h +++ b/src/qml/jsruntime/qv4object_p.h @@ -220,7 +220,7 @@ public: bool arrayPut(uint index, const Value &value) { return arrayData()->vtable()->put(this, index, value); } - bool arrayPut(uint index, Value *values, uint n) { + bool arrayPut(uint index, const Value *values, uint n) { return arrayData()->vtable()->putArray(this, index, values, n); } void setArrayAttributes(uint i, PropertyAttributes a) { @@ -333,17 +333,17 @@ namespace Heap { struct BooleanObject : Object { BooleanObject(InternalClass *ic, QV4::Object *prototype) - : Object(ic, prototype) + : Object(ic, prototype), + b(false) { - value = Encode((bool)false); } - BooleanObject(ExecutionEngine *engine, const Value &val) - : Object(engine->emptyClass, engine->booleanPrototype.asObject()) + BooleanObject(ExecutionEngine *engine, bool b) + : Object(engine->emptyClass, engine->booleanPrototype.asObject()), + b(b) { - value = val; } - Value value; + bool b; }; struct NumberObject : Object { @@ -383,7 +383,7 @@ struct BooleanObject: Object { V4_OBJECT2(BooleanObject, Object) Q_MANAGED_TYPE(BooleanObject) - Value value() const { return d()->value; } + bool value() const { return d()->b; } }; |