272 Commits
Author SHA1 Message Date
Thomas Weber 0cb82afe62 Query security manager extension permissions concurrently (#400) 2026-10-31 15:32:29 -05:00
Thomas Weber cecd467dd2 Wait for custom fonts to load before continuing (#401) 2026-10-31 15:31:42 -05:00
Thomas Weber ce39f140de Improve extension error handling (#399)
* Improve extension error handling
* Allow loading the extension again if it fails
2026-10-31 14:15:08 -05:00
Thomas Weber c985ca5d10 Fix snapshot tests on Windows (#398)
* Fix snapshot comparisons being backwards
* Always check out snapshots with LF endings
2026-10-31 09:54:21 -05:00
Thomas Weber 984b4f4365 Always reject javascript: URLs in canEmbed 2026-10-23 22:39:44 -05:00
Thomas Weber e9c6e122bf Implement argument defaults in addAddonBlock 2026-10-18 17:08:11 -05:00
Thomas Weber be4e8c288e Add sampler API (#394) 2026-10-18 16:32:07 -05:00
Thomas Weber 7387fa0883 Replace tap with node:test (#393) 2026-10-18 14:43:49 -05:00
Thomas Weber 52f4369e63 Fix spork compatibility issue with mutation-less control_stop
Our editor relies on the mutation for control_stop to know if there is a connection below.
Spork does not export that mutation anymore.
Instead, we will just generate the mutation to fix errors on loading.
2026-05-03 10:27:39 -05:00
7b521ff000 Force shadow property for procedure blocks during deserialization (#335)
Co-authored-by: Cubester <78769806+CubesterYT@users.noreply.github.com>
Co-authored-by: Thomas Weber <muffin@muffin.ink>
2026-04-18 22:18:21 -05:00
Thomas Weber 1ea395fe97 Don't allow reading video motion when external communication is possible (#331) 2026-02-08 11:22:19 -06:00
Thomas Weber 6abc33d787 Remove immutable.js (#329)
Why:
* We use immutable.js 3.8.2 which is ancient and not getting updates
* immutable.js adds 55KB to the bundle, of which we use almost nothing
* immutable.js's treatment of 0 and -0 is nonsensical and would require weird workarounds like https://github.com/TurboWarp/scratch-vm/pull/320
* We don't benefit from the whole immutability thing

What we're doing instead:
* We have our own MonitorState and MonitorRecord classes
* We track dirty-ness at modification time instead of equality checking every tick
* scratch-gui and packager can continue to think we use immutable.js without causing issues in either direction
  * our objects have enough stubs that immutable.js-expecting consumers are ok
  * when receiving an object, we check if it looks like an immutable.js one and ask for the plain JS version so that works okay too
2026-01-09 22:30:18 -06:00
Tacodiva cc96ee8c70 Fix -0 being turned into 0 in the type matrix test 2025-09-21 22:59:06 +10:00
Tacodiva b8defadedb Merge remote-tracking branch 'origin/develop' into HEAD 2025-09-07 11:56:25 +10:00
Thomas Weber ba9ae068ca Don't compress formats that are already compressed (#258)
Closes https://github.com/TurboWarp/scratch-vm/issues/253
2025-05-13 21:45:21 -05:00
Thomas Weber b8520ccd9a Fix visual report error when thread target does not match editing target
Fixes #252
2025-03-27 13:34:21 -05:00
Thomas Weber 2d29cdc63a Quit VM when execute test times out
A future test project will be designed such that failing to
quit the VM after timing out would severely inhibit the
performance of the other tests.
2025-03-07 01:11:17 -06:00
Thomas Weber af3b7513a4 ir: Match vanilla quirks when handling variable or list fields with null ID 2025-01-18 00:29:09 -06:00
Thomas Weber fdd954c012 Add URL argument to Scratch.canDownload
This lets us filter out javascript: URLs
2024-12-22 17:46:09 -06:00
Thomas Weber 1a578aa44e Add canDownload API
https://github.com/TurboWarp/scratch-gui/issues/969
2024-12-22 11:51:26 -06:00
Muffin 9e6993de27 Add restricted fonts and case insensitivity to font manager (#231) 2024-11-02 21:39:44 -05:00
Tacodiva df65b01cde Merge branch 'origin/develop' into next-next 2024-09-26 11:50:09 +10:00
Tacodiva 59cc74c10b Fix imports :c 2024-07-28 20:31:07 +10:00
Muffin 658ef8aba7 Add test for sb3 creation being deterministic over time 2024-07-18 12:44:49 -05:00
Tacodiva 02806b654a Linty linty code 2024-06-17 10:37:37 +10:00
Tacodiva 71b75aad51 Add type assertion checking 2024-06-16 13:50:39 +10:00
Tacodiva 9d28fccb99 Add operator type testing 2024-06-16 13:50:30 +10:00
Muffin 30a614dfc4 Expose compatibility layer stack frame on thread
For https://github.com/TurboWarp/scratch-vm/issues/212
2024-06-14 14:32:35 -05:00
Muffin d39a30fb23 Replace wrapAssetRequest promise argument with a callback
The flexibility may be useful later
2024-05-22 20:36:25 -05:00
Muffin d69256aa2d Replace jszip with @turbowarp/jszip 2024-05-19 21:58:36 -05:00
Muffin f548d1b33c Fix stopping a thread from inside of its blocks
Works in command or reporter after yielding or not.
These snippets are covered by the tests:
thread.status = Thread.STATUS_DONE;
thread.status = 4; (indirectly)
sequencer.retireThread(thread);
2024-05-15 14:46:23 -05:00
Muffin 0593628e24 Fix rejected promise behavior in interpreter and compiler
Before this command:
- Interpreter would popStack() and continue. Inside a loop this was like JS continue, outside it was like return
- Compiler would return literal undefined and keep going.

After this commit:
Both return the error as a string and then continue as normal.
This has several benefits:
- Users can actually see the error messages
- Logical execution flow
- Consistent behavior
- Blocks aren't even supposed to return rejected promises anyways
- No vanilla blocks return rejected promises so no compatibility concerns

Supersedes https://github.com/TurboWarp/scratch-vm/pull/207
2024-05-09 00:18:18 -05:00
JeremyGamer13andMuffin 31c9eba1aa Add platform info (#205)
- Platform info is now stored in project.json.
- Available to extensions on vm.runtime.platform.
- When loading a project with a different platform, emit an event and wait for callbacks before continuing.

Co-authored-by: Muffin <muffin@muffin.ink>
2024-05-08 23:01:26 -05:00
Muffin a15c069ac6 Improve promise-like extension block test
notably, fail on compiler errors, and run the test block several times
2024-01-26 20:39:05 -06:00
Muffin b3e621c61b Add test for promise-like blocks 2024-01-21 13:44:54 -06:00
Muffin cd9782a64c Replace minilog with nanolog 2024-01-14 01:48:32 -06:00
Muffin c857903321 Replace use of deprecated vm.stop() in branch tests 2024-01-13 21:23:09 -06:00
Muffin ce0b7d73ff Add test for starting a substack beyond branchCount 2024-01-13 21:09:57 -06:00
Muffin e4e461ac84 Reset runtime's extension storage when loading a new project 2024-01-03 03:35:39 -06:00
GarboMuffin 8297dd4cc9 Add native loading progress tracking (#180) 2024-01-03 00:56:54 -06:00
GarboMuffin dd848dbbf6 Extension storage (#179) 2024-01-02 23:19:51 -06:00
Muffin 7e9dab88f4 Allow serializing and deserializing infinite length comments
Goes along with https://github.com/TurboWarp/scratch-blocks/commit/78177be01aab589a6cbd9844d530df02258d09c2
2023-12-31 01:09:00 -06:00
Muffin 9f26069ad6 merge-upstream: Fix ESLint errors 2023-12-22 17:56:40 -06:00
Muffin 81a0382e0f merge-upstream: initial merge of upstream/develop
installs & compiles but has test errors

aside from expected merge conflicts, notable changes from upstream:
 - removed husky, commitlint, etc.
 - removed semantic-release etc.
2023-12-22 17:25:21 -06:00
Muffin c9f93b9de7 Resolve relative Scratch.canEmbed() URLs before sending to security manager 2023-12-03 18:03:53 -06:00
Muffin ec25b30c4a Fix compiler regression when last block in loop returns a Promise 2023-08-26 21:45:53 -05:00
Muffin 4845bf89a1 Update loop and conditional tests 2023-08-23 15:59:31 -05:00
Muffin 8b43eae4de Make addBuiltinExtension per-VM, not global 2023-08-23 13:37:04 -05:00
Muffin e9f0a3686c Implement LOOP blocks in interpreter 2023-08-22 16:34:47 -05:00
Muffin 87119eadb7 Implement CONDITIONAL blocks in interpreter 2023-08-22 16:34:47 -05:00