Revert loop on 'for ... if ...'

This commit is contained in:
K. Lange 2022-05-24 13:27:01 +09:00
parent 341fd877d5
commit b9776aec1e

View File

@ -2777,7 +2777,7 @@ static void comprehensionInner(KrkScanner scannerBefore, Parser parserBefore, vo
if (match(TOKEN_IF)) {
parsePrecedence(PREC_OR);
int acceptJump = emitJump(OP_JUMP_IF_TRUE_OR_POP);
emitLoop(loopStart, OP_LOOP_ITER);
emitLoop(loopStart, OP_LOOP);
patchJump(acceptJump);
emitByte(OP_POP); /* Pop condition */
}