aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4vme_moth.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4vme_moth.cpp')
-rw-r--r--src/qml/jsruntime/qv4vme_moth.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp
index 6ed371bbf2..07eb054350 100644
--- a/src/qml/jsruntime/qv4vme_moth.cpp
+++ b/src/qml/jsruntime/qv4vme_moth.cpp
@@ -661,9 +661,16 @@ QV4::ReturnedValue VME::interpret(CppStackFrame *frame, ExecutionEngine *engine,
MOTH_BEGIN_INSTR(Yield)
frame->yield = code;
+ frame->yieldIsIterator = false;
return acc;
MOTH_END_INSTR(Yield)
+ MOTH_BEGIN_INSTR(YieldStar)
+ frame->yield = code;
+ frame->yieldIsIterator = true;
+ return acc;
+ MOTH_END_INSTR(YieldStar)
+
MOTH_BEGIN_INSTR(Resume)
// check exception, in case the generator was called with throw() or return()
if (engine->hasException) {
@@ -672,11 +679,17 @@ QV4::ReturnedValue VME::interpret(CppStackFrame *frame, ExecutionEngine *engine,
goto handleUnwind;
engine->hasException = false;
*engine->exceptionValue = Primitive::undefinedValue();
- } else {
- code += offset;
- }
+ } else {
+ code += offset;
+ }
MOTH_END_INSTR(Resume)
+ MOTH_BEGIN_INSTR(IteratorNextForYieldStar)
+ STORE_ACC();
+ acc = Runtime::method_iteratorNextForYieldStar(engine, accumulator, STACK_VALUE(iterator), &STACK_VALUE(object));
+ CHECK_EXCEPTION;
+ MOTH_END_INSTR(IteratorNextForYieldStar)
+
MOTH_BEGIN_INSTR(CallValue)
STORE_IP();
Value func = STACK_VALUE(name);