From bdeafbaf75dcffd0f45288624ac6579710f6e9da Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Fri, 13 Feb 2026 08:42:20 +0100 Subject: [PATCH] fix: remove prebake specific logic in transpiler --- packages/transpiler/transpiler.mjs | 3 +-- website/src/repl/useReplContext.jsx | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/transpiler/transpiler.mjs b/packages/transpiler/transpiler.mjs index 09ebf1958..1f783794f 100644 --- a/packages/transpiler/transpiler.mjs +++ b/packages/transpiler/transpiler.mjs @@ -25,7 +25,6 @@ export function transpiler(input, options = {}) { emitMiniLocations = true, emitWidgets = true, blockBased = false, - prebake = false, range = [], } = options; @@ -269,7 +268,7 @@ export function transpiler(input, options = {}) { } // add return to last statement - if (addReturn && !prebake) { + if (addReturn) { const { expression } = body[body.length - 1]; body[body.length - 1] = { type: 'ReturnStatement', diff --git a/website/src/repl/useReplContext.jsx b/website/src/repl/useReplContext.jsx index 115133efc..390faa093 100644 --- a/website/src/repl/useReplContext.jsx +++ b/website/src/repl/useReplContext.jsx @@ -43,7 +43,7 @@ import { debugAudiograph } from './audiograph'; const { latestCode, maxPolyphony, audioDeviceName, multiChannelOrbits } = settingsMap.get(); let modulesLoading, presets, drawContext, clearCanvas, audioReady; -const evaluateUserPrebake = (code) => evaluate(code, transpiler, { prebake: true }); +const evaluateUserPrebake = (code) => evaluate(code, transpiler, { addReturn: false }); if (typeof window !== 'undefined') { audioReady = initAudioOnFirstClick({