aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4runtime.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-07-03 11:07:15 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2018-07-03 11:19:03 +0000
commitfc01254cf89543e509e8ebaca93aac7f009247dd (patch)
tree5da1b88e31797bc7dfa63343d3a9e9c3659c8252 /src/qml/jsruntime/qv4runtime.cpp
parenta2372fd2c643615687ea3b8b1ccf53d699b6debd (diff)
Fix class members that are generators
Properly support member functions that are generators in classes. Change-Id: I5fc8d5b58a17c61a446b43d6576bb83de5ecd920 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4runtime.cpp')
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index 9848c60602..f387285e37 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -1569,7 +1569,10 @@ ReturnedValue Runtime::method_createClass(ExecutionEngine *engine, int classInde
}
QV4::Function *f = unit->runtimeFunctions[methods[i].function];
Q_ASSERT(f);
- function = FunctionObject::createMemberFunction(current, f);
+ if (f->isGenerator())
+ function = MemberGeneratorFunction::create(current, f);
+ else
+ function = FunctionObject::createMemberFunction(current, f);
Q_ASSERT(function);
PropertyAttributes attributes;
switch (methods[i].type) {