From 62f890e59d8fa7ae6fae38b4152604250b4503d1 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Fri, 17 Oct 2025 12:13:28 -0700 Subject: [PATCH] don't be cute --- src/vm.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/vm.ts b/src/vm.ts index de679fb..82bbb46 100644 --- a/src/vm.ts +++ b/src/vm.ts @@ -383,7 +383,6 @@ export class VM { }) break - // @ts-ignore case OpCode.TRY_CALL: { const varName = instruction.operand as string const value = this.scope.get(varName) @@ -392,7 +391,9 @@ export class VM { this.stack.push(value) this.stack.push(toValue(0)) this.stack.push(toValue(0)) - // No `break` here -- we want to fall through to OpCode.CALL! + this.instructions[this.pc] = { op: OpCode.CALL } + this.pc-- + break } else if (value) { this.stack.push(value) break @@ -402,8 +403,6 @@ export class VM { } } - // don't put any `case` statement here - `TRY_CALL` MUST go before `CALL!` - case OpCode.CALL: { // Pop named count from stack (top) const namedCount = toNumber(this.stack.pop()!)