diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-06-22 12:32:13 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-06-26 10:04:18 +0000 |
commit | eae4756f74d70de46d9345ece54345f597bc1929 (patch) | |
tree | 3bd9de778a4a035a79595ed160c7b474a03695ec /src/qml/jsruntime/qv4engine.cpp | |
parent | e9b3bdb96e008060a0e78815a3995015e5e4598d (diff) |
Add a MemberFunction function object
Member functions in ES7 can not be called as constructors and
will throw a type error when trying.
Some more fixes are needed here, as they also do not have a
prototype property.
Change-Id: Ieb920163acaa68d4ff0ff73ae4c1015e883b406f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index 657c267f7c..bdf1c93d0c 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -343,6 +343,10 @@ ExecutionEngine::ExecutionEngine(QJSEngine *jsEngine) classes[Class_ScriptFunction] = ic->d(); ic = ic->changeVTable(ConstructorFunction::staticVTable()); classes[Class_ConstructorFunction] = ic->d(); + ic = ic->changeVTable(MemberFunction::staticVTable()); + classes[Class_MemberFunction] = ic->d(); + ic = ic->changeVTable(GeneratorFunction::staticVTable()); + classes[Class_MemberFunction] = ic->d(); ic = ic->changeVTable(GeneratorFunction::staticVTable()); classes[Class_GeneratorFunction] = ic->d(); classes[Class_ObjectProto] = classes[Class_Object]->addMember(id_constructor()->identifier(), Attr_NotEnumerable, &index); |