aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4dateobject_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-05-09 14:14:02 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2014-07-22 13:49:18 +0200
commit0fd24cf96e79bea3fb625563ddd3ce6f1ca8bd4b (patch)
tree6dc96a61c65b8c6ecf1c2f362510630af56e2d60 /src/qml/jsruntime/qv4dateobject_p.h
parentdba56a752c932670c0e9461f106d2bc084276b6f (diff)
Convert most simple objects to the new constructor scheme
Change-Id: I90042037bc0555771bd98233977c7d2b735bb718 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.h26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/qml/jsruntime/qv4dateobject_p.h b/src/qml/jsruntime/qv4dateobject_p.h
index 3e8bdc3edf..d285680268 100644
--- a/src/qml/jsruntime/qv4dateobject_p.h
+++ b/src/qml/jsruntime/qv4dateobject_p.h
@@ -53,6 +53,18 @@ namespace QV4 {
struct DateObject: Object {
struct Data : Object::Data {
+ Data(ExecutionEngine *engine, const ValueRef date)
+ : Object::Data(engine->dateClass)
+ {
+ value = date;
+ }
+ Data(ExecutionEngine *engine, const QDateTime &date);
+ Data(InternalClass *ic)
+ : Object::Data(ic)
+ {
+ Q_ASSERT(internalClass->vtable == staticVTable());
+ value = Primitive::fromDouble(qSNaN());
+ }
Value value;
};
struct {
@@ -66,20 +78,7 @@ struct DateObject: Object {
Value &date() { return d()->value; }
void setDate(const ValueRef date) { d()->value = date; }
- DateObject(ExecutionEngine *engine, const ValueRef date)
- : Object(engine->dateClass)
- {
- setDate(date);
- }
- DateObject(ExecutionEngine *engine, const QDateTime &date);
-
QDateTime toQDateTime() const;
-
-protected:
- DateObject(InternalClass *ic): Object(ic) {
- Q_ASSERT(internalClass()->vtable == staticVTable());
- d()->value = Primitive::fromDouble(qSNaN());
- }
};
struct DateCtor: FunctionObject
@@ -95,7 +94,6 @@ struct DateCtor: FunctionObject
struct DatePrototype: DateObject
{
- DatePrototype(InternalClass *ic): DateObject(ic) {}
void init(ExecutionEngine *engine, Object *ctor);
static double getThisDate(ExecutionContext *ctx);