diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-10-20 15:21:20 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-11-07 09:00:30 +0000 |
commit | f7cc4b4acd97871f99d146da3bbeed951ff4670c (patch) | |
tree | 3a2755c5704ea248a9c00d967588d53c29e62a8b /src/qml/jsruntime/qv4functionobject_p.h | |
parent | c6c79644dc869259482a011f8b737f709af02fb2 (diff) |
Add a FunctionObject::call(AsConstructor) overload
add an overload taking a JSCallData for convenience.
Change-Id: I8ebc190354943e6ceed676c3c0e1803586426769
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4functionobject_p.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h index 92ec40fe87..398fd8b207 100644 --- a/src/qml/jsruntime/qv4functionobject_p.h +++ b/src/qml/jsruntime/qv4functionobject_p.h @@ -63,6 +63,7 @@ namespace QV4 { struct BuiltinFunction; 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); @@ -155,9 +156,11 @@ struct Q_QML_EXPORT FunctionObject: Object { void init(String *name, bool createProto); + inline ReturnedValue callAsConstructor(const JSCallData &data) const; ReturnedValue callAsConstructor(const Value *argv, int argc) const { return d()->jsConstruct(this, argv, argc); } + inline ReturnedValue call(const JSCallData &data) const; ReturnedValue call(const Value *thisObject, const Value *argv, int argc) const { return d()->jsCall(this, thisObject, argv, argc); } |