From c3ad706c6ff19a132bf78501430c850040e967fc Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 21 Mar 2018 12:25:51 +0100 Subject: Added support for generator functions and yield expressions to the AST Some smaller changes to the codegen are included as well to ensure that we catch all uses of generators and properly throw an unimplemented error on them for now. Change-Id: Ib915a0e862e128644ff00dfe989507783c912c66 Reviewed-by: Simon Hausmann --- src/qml/compiler/qv4compiler.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/qml/compiler/qv4compiler.cpp') diff --git a/src/qml/compiler/qv4compiler.cpp b/src/qml/compiler/qv4compiler.cpp index 4bc3940a02..d870c34101 100644 --- a/src/qml/compiler/qv4compiler.cpp +++ b/src/qml/compiler/qv4compiler.cpp @@ -308,6 +308,8 @@ void QV4::Compiler::JSUnitGenerator::writeFunction(char *f, QV4::Compiler::Conte function->flags |= CompiledData::Function::IsStrict; if (irFunction->isArrowFunction) function->flags |= CompiledData::Function::IsArrowFunction; + if (irFunction->isGenerator) + function->flags |= CompiledData::Function::IsGenerator; if (irFunction->hasTry || irFunction->hasWith) function->flags |= CompiledData::Function::HasCatchOrWith; function->nestedFunctionIndex = -- cgit v1.2.3