From b8dbd08705fa698b516addbe5ce07159cce0409b Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 13 Feb 2015 11:31:45 +0100 Subject: Get rid of Value::asDateObject() Change-Id: I71816a784b5175f600c5a870318b16c0d84c42fb Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4dateobject_p.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/qml/jsruntime/qv4dateobject_p.h') diff --git a/src/qml/jsruntime/qv4dateobject_p.h b/src/qml/jsruntime/qv4dateobject_p.h index dad3689054..33c967b3da 100644 --- a/src/qml/jsruntime/qv4dateobject_p.h +++ b/src/qml/jsruntime/qv4dateobject_p.h @@ -61,6 +61,7 @@ struct DateObject : Object { Value value; }; + struct DateCtor : FunctionObject { DateCtor(QV4::ExecutionContext *scope); }; @@ -79,6 +80,11 @@ struct DateObject: Object { QDateTime toQDateTime() const; }; +template<> +inline const DateObject *Value::as() const { + return isManaged() && m->vtable->type == Managed::Type_DateObject ? static_cast(this) : 0; +} + struct DateCtor: FunctionObject { V4_OBJECT2(DateCtor, FunctionObject) -- cgit v1.2.3