Commit Graph
7009 Commits
Author SHA1 Message Date
Thomas Weber fa035541da Give up analyzing looped stack after 10000 iterations
Temporary fix for an infinite loop, to be properly fixed later
2025-09-20 13:53:41 -05:00
Thomas Weber e1ad53e7f5 Add compatibility layer for extensions relying on old compiler (#264)
The new compiler broke all the extensions doing compiler patches. We promised not to help them when those break but it seems enough people use those extensions that we sort of got forced into finding some solution, so this makes these changes:

 - The exports for the new compiler are now in `these_broke_before_and_will_break_again`
 - `i_will_not_ask_for_help_when_these_break` now returns some stubs that pretend to be the old compiler. It also emits an event so -gui can show a warning.
 - Focus is on compatibility & safety, not performance. There will be unnecessary casts and scripts marked as yielding.
 - Extensions that meet these assumptions should work without changes:
   - Extensions do not try to combine this compatibility layer with any APIs provided by the new compiler.
   - Extensions treat IR nodes received from descendSubstack and similar as opaque objects because they will be the new intermediate objects instead of { kind: "..." }
   - Extensions need to implement the JS generators for all AST node kinds they use. Can not rely on the default JS generator because those generators are expecting a different format than { kind: "..." }

Lack of tests is intentional since this will be removed at some point when we have a proper API we can tell people to use
2025-09-14 11:14:18 -05:00
Tacodiva 98df18aeb7 Merge pull request #216 from Tacodiva/next-next
New compiler!!!!
2025-09-13 15:25:17 +10:00
Tacodiva 7ed29f5801 Fix sound dropdown playing wrong sound when sounds have a number name 2025-09-08 17:11:50 +10:00
Tacodiva 7cc8f580b3 Fix yielding loop arguments not re-analyzing 2025-09-08 17:08:23 +10:00
Tacodiva d8c73c71d2 Account for stop this script in type analysis and add test 2025-09-08 15:28:11 +10:00
Tacodiva 6a37fee386 Re-analyze loop block inputs after each loop 2025-09-08 15:11:03 +10:00
Tacodiva fbca1bf49b Fixed NaN = 0 wrongly reporting true, and add a test 2025-09-08 11:48:55 +10:00
Tacodiva b8defadedb Merge remote-tracking branch 'origin/develop' into HEAD 2025-09-07 11:56:25 +10:00
Thomas Weber 6222be2a3c Fix wrong drawables being marked non-interactive 2025-06-07 18:33:32 -05:00
Thomas Weber df92bc2899 Mark video sensing drawable as non-interactive 2025-06-07 18:17:42 -05:00
Thomas Weber ef02dc86d8 Mark pen drawable as non-interactive
Using API added in https://github.com/TurboWarp/scratch-render/commit/1ffefcf2cdff2fcbe0bc7f0f000521ae2843f3a8
This replaces the hardcoded PenSkin exclusion in the renderer
2025-06-07 18:13:45 -05:00
Thomas Weber fa82d53a94 Update GitHub Actions workflows
- update actions/setup-node to fix extra 10 minute delay in CI
- update Node.js
- use version ranges instead of commit hashes to get future updates
  automatically (we already trust the GitHub Actions team)
- don't use npm cache in deploy workflow
2025-06-04 13:04:22 -05:00
Thomas Weber bf572166ab Update scratch-parser 2025-05-31 18:19:47 -05:00
ghost 5bc497aabb Add blockShape option to extensions (#210) 2025-05-20 21:48:52 -05:00
Thomas Weber f957e1c6c1 Fix Mouse.postData error if called before project loads 2025-05-20 13:29:44 -05:00
Thomas Weber 4eb911771d Update sb3fix 2025-05-13 23:02:37 -05: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 1da38dad80 Update GitHub Actions workflow
- Node.js 22
- Replace npm run test with npm run tap to avoid unnecessarily running ESLint twice
2025-03-27 13:11:23 -05:00
Thomas Weber 7ef5e29c16 interpreter: fix skipped blocks in recursive procedures using "stop this script"
Closes https://github.com/TurboWarp/scratch-vm/issues/249
Regression from 20f25f252c
2025-03-07 01:21:08 -06: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 709d155be8 npm audit fix 2025-02-19 22:10:44 -06:00
Muffin cd63c87f07 js: reset variable types after compatibility layer call
Fixes https://github.com/TurboWarp/scratch-vm/issues/245
2025-02-11 00:49:36 -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 2c9d301da2 ir: Fix variable cache collision when variable or list field has null ID
Fixes https://github.com/TurboWarp/scratch-vm/issues/239
2025-01-18 00:09:09 -06:00
Miyo Sho 36c02f3fec Expose Variable on the VM exports (#237) 2024-12-27 16:45:09 -06:00
熊谷 凌 56825e3744 Allow refreshBlocks() to specify extension (#228) 2024-12-25 22:56:30 -06:00
Thomas Weber b900a375fa Update workflows based on zizmor audit 2024-12-24 19:58:46 -06:00
Thomas Weber c3b60f6fb6 Add Scratch.download API 2024-12-22 17:46:17 -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
凌 fed099c4cc Fix isRecursiveCall failing on flyout blocks (#227) 2024-09-30 22:47:02 -05:00
Tacodiva df65b01cde Merge branch 'origin/develop' into next-next 2024-09-26 11:50:09 +10:00
Muffin 179030ad49 Don't eagerly cast boolean arguments to boolean (#223)
Fixes https://github.com/TurboWarp/scratch-vm/issues/222
2024-09-08 11:56:47 -05:00
Muffin 99ff662f7f Don't emit STAGE_SIZE_CHANGED if stage size didn't change
and also fix the other STAGE_SIZE_CHANGED event test to
actually test that it is being fired when there is a change
2024-07-31 15:16:44 -05:00
Tacodiva 430353b1e3 Re-add JSGenerator.unstable_exports and expose enums as unsupported APIs 2024-07-28 20:36:24 +10:00
Tacodiva 59cc74c10b Fix imports :c 2024-07-28 20:31:07 +10:00
Tacodiva 34491603f8 Linty linty code 2024-07-28 20:22:30 +10:00
Tacodiva a589e57d9e Fix old and add new unsupported APIs. 2024-07-28 20:14:05 +10:00
Muffin 658ef8aba7 Add test for sb3 creation being deterministic over time 2024-07-18 12:44:49 -05:00
Muffin 4c366e0110 Use a fixed modification date when zipping 2024-07-17 14:27:33 -05:00
Tacodiva 177b899138 Fix issue when switching to costume with a number name 2024-07-03 12:58:07 +10:00
Tacodiva 1dd7744525 Handle colors correctly + more smartly 2024-07-03 12:45:49 +10:00
Tacodiva 1dc9aadf3f Fix issue when setting variables to InputType.ANY and add test 2024-06-25 18:25:47 +10:00
Tacodiva 02806b654a Linty linty code 2024-06-17 10:37:37 +10:00
Tacodiva 41e8167573 Fix snapshot tests falling back to "script" instead of the procedure variant 2024-06-17 10:06:33 +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