Skip to content

Conversation

@8to16
Copy link

@8to16 8to16 commented Dec 15, 2025

This is because beepbox's script:
https://cdn.jsdelivr.net/npm/[email protected]/global/beepbox_synth.min.js has a sourceMappingURL comment at the bottom for whatever reason, causing it to become
//# sourceMappingURL=beepbox_synth.min.js.map;return beepbox; This is obviously going to break and might also be the case with other libraries too, hot just beepbox.

So this PR changes it to add a newline before the return and also adds a semicolon after the return for compatibility with old js engines that don't support automatic semicolon injection.

Ported from AmpMod:
https://codeberg.org/ampmod/ampmod/commit/0daf1021bdc8e67a1f0d08b91ce500605fcaa711
I mostly made it specifically for AmpMod but it will definitely be useful for others who don't understand why evalAndReturn doesn't work sometimes.

8to16 and others added 2 commits December 15, 2025 22:03
This is because beepbox's script:
https://cdn.jsdelivr.net/npm/[email protected]/global/beepbox_synth.min.js
has a sourceMappingURL comment at the bottom for whatever
reason, causing it to become
//# sourceMappingURL=beepbox_synth.min.js.map;return beepbox;
This is obviously going to break and might also be the case with
other libraries too, hot just beepbox.

Ported from AmpMod:
https://codeberg.org/ampmod/ampmod/commit/0daf1021bdc8e67a1f0d08b91ce500605fcaa711
@GarboMuffin GarboMuffin merged commit 36bf998 into TurboWarp:develop Dec 16, 2025
1 check passed
supervoidcoder added a commit to OmniBlocks/scratch-vm that referenced this pull request Dec 24, 2025
Fix evalAndReturn with comments at the bottom of a script (TurboWarp#322)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants