aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4dateobject_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-04-29 10:57:23 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2014-07-22 13:49:03 +0200
commit06ad87eb0f8abde691026b9a72d372184d6d8249 (patch)
tree7536278f8f9e00cd662ede99b52e4810a4127428 /src/qml/jsruntime/qv4dateobject_p.h
parent3da391808eaa8b64e7e700965ce488d8b41e1705 (diff)
Convert DateObject over to new storage scheme
Change-Id: I34b391a79ef80ab09e892b9a00897b90b31802ef 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.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/qml/jsruntime/qv4dateobject_p.h b/src/qml/jsruntime/qv4dateobject_p.h
index 01d4ba88ea..a60f503915 100644
--- a/src/qml/jsruntime/qv4dateobject_p.h
+++ b/src/qml/jsruntime/qv4dateobject_p.h
@@ -52,17 +52,19 @@ class QDateTime;
namespace QV4 {
struct DateObject: Object {
- V4_OBJECT
- Q_MANAGED_TYPE(DateObject)
-
- struct Data {
+ struct Data : Object::Data {
Value value;
};
- Data data;
+ struct {
+ Value value;
+ } __data;
+ V4_OBJECT_NEW
+ Q_MANAGED_TYPE(DateObject)
+
- Value date() const { return data.value; }
- Value &date() { return data.value; }
- void setDate(const ValueRef d) { data.value = d; }
+ Value date() const { return d()->value; }
+ Value &date() { return d()->value; }
+ void setDate(const ValueRef date) { d()->value = date; }
DateObject(ExecutionEngine *engine, const ValueRef date)
: Object(engine->dateClass)
@@ -76,13 +78,13 @@ struct DateObject: Object {
protected:
DateObject(InternalClass *ic): Object(ic) {
Q_ASSERT(internalClass()->vtable == staticVTable());
- data.value = Primitive::fromDouble(qSNaN());
+ d()->value = Primitive::fromDouble(qSNaN());
}
};
struct DateCtor: FunctionObject
{
- V4_OBJECT
+ V4_OBJECT_NEW
DateCtor(ExecutionContext *scope);
static ReturnedValue construct(Managed *, CallData *callData);