made OP_ITER and OP_NEXT use CObjMethods

This commit is contained in:
2020-12-16 03:51:50 -06:00
parent e5eca7bed6
commit eede892eb0
4 changed files with 30 additions and 24 deletions

View File

@@ -1121,7 +1121,7 @@ static void forEachLoop(CParseState *pstate) {
consume(pstate, TOKEN_DO, "Expected 'do' before loop block!");
writeu8(pstate, OP_ITER); // checks if stack[top] is iterable and makes an iterable object wrapper for CObjs like CObjDict
writeu8(pstate, OP_ITER); // checks if stack[top] is iterable and pushes the __next method onto the stack for OP_NEXT to call
int loopStart = getChunk(pstate)->count;