aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4object_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-10-30 10:38:55 +0100
committerLars Knoll <lars.knoll@qt.io>2017-11-13 08:56:14 +0000
commit3daf05ec2d7dbc408e2c302cdade667ec719d847 (patch)
treea5efab7b4a0bf381da6aa9ae0e44ea50cce9ea59 /src/qml/jsruntime/qv4object_p.h
parent831ddc54932d2681712ca9fa3e94484ae11d59f7 (diff)
Introduce new calling convention for builtin functions
And implement Function.apply()/call() with it. Change-Id: I028c82d5f9adfd23328d669db1adccec9de5824c Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4object_p.h')
-rw-r--r--src/qml/jsruntime/qv4object_p.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h
index af68f09700..d2e7f3ff8c 100644
--- a/src/qml/jsruntime/qv4object_p.h
+++ b/src/qml/jsruntime/qv4object_p.h
@@ -288,8 +288,12 @@ struct Q_QML_EXPORT Object: Managed {
insertMember(name, value, Attr_Data|Attr_NotEnumerable);
}
void defineDefaultProperty(const QString &name, const Value &value);
+ // old calling convention
void defineDefaultProperty(const QString &name, ReturnedValue (*code)(const BuiltinFunction *, CallData *), int argumentCount = 0);
void defineDefaultProperty(String *name, ReturnedValue (*code)(const BuiltinFunction *, CallData *), int argumentCount = 0);
+ // new calling convention
+ void defineDefaultProperty(const QString &name, ReturnedValue (*code)(const FunctionObject *, const Value *thisObject, const Value *argv, int argc), int argumentCount = 0);
+ void defineDefaultProperty(String *name, ReturnedValue (*code)(const FunctionObject *, const Value *thisObject, const Value *argv, int argc), int argumentCount = 0);
void defineAccessorProperty(const QString &name, ReturnedValue (*getter)(const BuiltinFunction *, CallData *),
ReturnedValue (*setter)(const BuiltinFunction *, CallData *));
void defineAccessorProperty(String *name, ReturnedValue (*getter)(const BuiltinFunction *, CallData *),