From dba56a752c932670c0e9461f106d2bc084276b6f Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 9 May 2014 12:15:23 +0200 Subject: Convert remaining FunctionObject's to new constructor scheme Change-Id: I440d5b128d0ee28566ebfa82c2505a4bd97bba6b Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4functionobject.cpp | 48 +++------------------------------ 1 file changed, 4 insertions(+), 44 deletions(-) (limited to 'src/qml/jsruntime/qv4functionobject.cpp') diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index c3b4860730..1cbc803ebd 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -112,48 +112,6 @@ FunctionObject::Data::Data(InternalClass *ic) memberData[Index_Prototype] = Encode::undefined(); } -FunctionObject::FunctionObject(ExecutionContext *scope, String *name, bool createProto) - : Object(scope->d()->engine->functionClass) -{ - d()->scope = scope; - d()->function = 0; - init(name, createProto); -} - -FunctionObject::FunctionObject(ExecutionContext *scope, const QString &name, bool createProto) - : Object(scope->d()->engine->functionClass) -{ - d()->scope = scope; - d()->function = 0; - - Scope s(scope); - ScopedValue protectThis(s, this); - ScopedString n(s, s.engine->newString(name)); - init(n.getPointer(), createProto); -} - -FunctionObject::FunctionObject(ExecutionContext *scope, const ReturnedValue name) - : Object(scope->d()->engine->functionClass) -{ - d()->scope = scope; - d()->function = 0; - - Scope s(scope); - ScopedValue protectThis(s, this); - ScopedString n(s, name); - init(n.getPointer(), false); -} - -FunctionObject::FunctionObject(InternalClass *ic) - : Object(ic) -{ - d()->scope = ic->engine->rootContext; - d()->function = 0; - - d()->needsActivation = false; - d()->strictMode = false; - memberData()[Index_Prototype] = Encode::undefined(); -} FunctionObject::Data::~Data() { @@ -288,8 +246,10 @@ ReturnedValue FunctionCtor::call(Managed *that, CallData *callData) return construct(that, callData); } -FunctionPrototype::FunctionPrototype(InternalClass *ic) - : FunctionObject(ic) +DEFINE_OBJECT_VTABLE(FunctionPrototype); + +FunctionPrototype::Data::Data(InternalClass *ic) + : FunctionObject::Data(ic) { } -- cgit v1.2.3