Compare commits

..

1 Commits

Author SHA1 Message Date
a6261fce7f implicit function-level try blocks 2025-10-29 14:50:59 -07:00

View File

@ -278,12 +278,13 @@ export class Compiler {
return bodyInstructions return bodyInstructions
} }
if (catchVariable || finallyBody) {
// If function has catch or finally, wrap body in try/catch/finally // If function has catch or finally, wrap body in try/catch/finally
if (catchVariable || finallyBody) {
instructions.push( instructions.push(
...this.#compileTryCatchFinally(compileFunctionBody, catchVariable, catchBody, finallyBody, input) ...this.#compileTryCatchFinally(compileFunctionBody, catchVariable, catchBody, finallyBody, input)
) )
} else { } else {
// Normal function without catch/finally
instructions.push(...compileFunctionBody()) instructions.push(...compileFunctionBody())
} }