diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-04-26 11:48:04 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-02 14:20:21 +0000 |
commit | c7fe748850383c5afcc18acf5568be0badd95c93 (patch) | |
tree | 99d5fc744b154b879496822a655859d491327224 /src/qml/jsruntime/qv4functionobject_p.h | |
parent | 440a25388b55d465873647b3dc9f470ed68e917e (diff) |
Cleanup creation code for builtin functions
Centralize the code in FunctionObject::createBuiltinFunction and setup
function names and length properties there.
Change-Id: I21f1d42b475070ee091d96d97387149af1dc47f2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4functionobject_p.h | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h index 64cd0b96d3..c9efee1a46 100644 --- a/src/qml/jsruntime/qv4functionobject_p.h +++ b/src/qml/jsruntime/qv4functionobject_p.h @@ -64,9 +64,6 @@ namespace QV4 { struct IndexedBuiltinFunction; struct JSCallData; -typedef ReturnedValue (*jsCallFunction)(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); -typedef ReturnedValue (*jsConstructFunction)(const FunctionObject *, const Value *argv, int argc); - namespace Heap { @@ -168,11 +165,7 @@ struct Q_QML_EXPORT FunctionObject: Object { static ReturnedValue call(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); static Heap::FunctionObject *createScriptFunction(ExecutionContext *scope, Function *function); - static Heap::FunctionObject *createBuiltinFunction(ExecutionContext *scope, String *name, - ReturnedValue (*code)(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)) - { - return scope->engine()->memoryManager->allocate<FunctionObject>(scope, name, code); - } + static Heap::FunctionObject *createBuiltinFunction(ExecutionEngine *engine, StringOrSymbol *nameOrSymbol, jsCallFunction code, int argumentCount); bool strictMode() const { return d()->function ? d()->function->isStrict() : false; } bool isBinding() const; |