summaryrefslogtreecommitdiff
path: root/src/qml/jsruntime/qv4engine.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-05-09 11:35:47 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2014-07-22 13:49:17 +0200
commit00fa9049112385f65ccdcad02b8712a32626d20c (patch)
tree36ea7fe337a37aef9f30d1c1c5b795bb155d44ae /src/qml/jsruntime/qv4engine.cpp
parentdc7a53d85685e7ed768cc2ec9f4e0374b6a137f5 (diff)
downloadqtdeclarative-00fa9049112385f65ccdcad02b8712a32626d20c.tar.gz
Convert FunctionObject derived classes to new construction scheme
Change-Id: I0d43a79ed531a9d651bd00866d73113c05d95a09 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r--src/qml/jsruntime/qv4engine.cpp18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 84c522e75c..1f7d7565e2 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -336,7 +336,7 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory)
numberCtor = new (memoryManager) NumberCtor(rootContext);
booleanCtor = new (memoryManager) BooleanCtor(rootContext);
arrayCtor = new (memoryManager) ArrayCtor(rootContext);
- functionCtor = new (memoryManager) FunctionCtor(rootContext);
+ functionCtor = static_cast<HeapObject *>(new (this) FunctionCtor::Data(rootContext));
dateCtor = new (memoryManager) DateCtor(rootContext);
regExpCtor = new (memoryManager) RegExpCtor(rootContext);
errorCtor = new (memoryManager) ErrorCtor(rootContext);
@@ -412,7 +412,7 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory)
globalObject->defineDefaultProperty(QStringLiteral("unescape"), GlobalFunctions::method_unescape, 1);
Scoped<String> name(scope, newString(QStringLiteral("thrower")));
- thrower = newBuiltinFunction(rootContext, name.getPointer(), throwTypeError)->getPointer();
+ thrower = ScopedFunctionObject(scope, BuiltinFunction::create(rootContext, name.getPointer(), throwTypeError)).getPointer();
}
ExecutionEngine::~ExecutionEngine()
@@ -481,20 +481,6 @@ ExecutionContext *ExecutionEngine::pushGlobalContext()
return g;
}
-Returned<FunctionObject> *ExecutionEngine::newBuiltinFunction(ExecutionContext *scope, String *name, ReturnedValue (*code)(CallContext *))
-{
- BuiltinFunction *f = new (memoryManager) BuiltinFunction(scope, name, code);
- return f->asReturned<FunctionObject>();
-}
-
-Returned<BoundFunction> *ExecutionEngine::newBoundFunction(ExecutionContext *scope, FunctionObject *target, const ValueRef boundThis, const Members &boundArgs)
-{
- Q_ASSERT(target);
-
- BoundFunction *f = new (memoryManager) BoundFunction(scope, target, boundThis, boundArgs);
- return f->asReturned<BoundFunction>();
-}
-
Returned<Object> *ExecutionEngine::newObject()
{