diff options
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 18 |
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() { |