diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-04-05 21:03:37 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-07-22 13:48:55 +0200 |
commit | 1b008d6fb89c82d4a31d30cc1abe3128c723a851 (patch) | |
tree | 755473e6db6f129577d1600c418c606d3376bbdd /src/qml/jsruntime/qv4dateobject_p.h | |
parent | 393c92a82170260fc322f7fc389a5594d71a8876 (diff) |
Convert Boolean, Number and DateObject
Change-Id: I8815578422fe1af87eb5f02899f35131fea70b76
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4dateobject_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4dateobject_p.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4dateobject_p.h b/src/qml/jsruntime/qv4dateobject_p.h index 7619d553ea..01d4ba88ea 100644 --- a/src/qml/jsruntime/qv4dateobject_p.h +++ b/src/qml/jsruntime/qv4dateobject_p.h @@ -54,18 +54,29 @@ namespace QV4 { struct DateObject: Object { V4_OBJECT Q_MANAGED_TYPE(DateObject) - Value value; - DateObject(ExecutionEngine *engine, const ValueRef date): Object(engine->dateClass) { - value = date; + + struct Data { + Value value; + }; + Data data; + + Value date() const { return data.value; } + Value &date() { return data.value; } + void setDate(const ValueRef d) { data.value = d; } + + DateObject(ExecutionEngine *engine, const ValueRef date) + : Object(engine->dateClass) + { + setDate(date); } - DateObject(ExecutionEngine *engine, const QDateTime &value); + DateObject(ExecutionEngine *engine, const QDateTime &date); QDateTime toQDateTime() const; protected: DateObject(InternalClass *ic): Object(ic) { Q_ASSERT(internalClass()->vtable == staticVTable()); - value = Primitive::fromDouble(qSNaN()); + data.value = Primitive::fromDouble(qSNaN()); } }; |