Commit Graph
7045 Commits
Author SHA1 Message Date
Thomas Weber d09f82a2fe Add new test case that does some simple string operations 2025-10-08 17:15:24 -05:00
Thomas Weber 2ee8d6cf6b Merge pull request #299 from TurboWarp/face-sensing
Add face sensing to default extension URLs
2025-10-07 18:12:47 -05:00
Thomas Weber 4ab24673c9 Add face sensing to default extension URLs 2025-10-07 18:06:10 -05:00
Thomas Weber d848fd0e6e Convert default extension URLs from dict to object 2025-10-07 18:05:47 -05:00
Thomas Weber 51aacba14c Merge pull request #295 from TurboWarp/optimize-loops
Optimize loops with provably-non-fraction iteration counts
2025-10-05 08:54:44 -05:00
Thomas Weber 5c5ff712b0 Merge pull request #296 from TurboWarp/round-floor-ceil-type
Use more specific type for round, floor, ceiling
2025-10-05 08:48:20 -05:00
Thomas Weber 2a2d15282b Infinite iteration count can also use simpler condition 2025-10-04 20:37:54 -05:00
Thomas Weber a2701efdf5 Use more specific type for round, floor, ceiling 2025-10-04 20:36:46 -05:00
Thomas Weber 2ac7095947 Optimize loops with provably-integer iteration counts 2025-10-04 20:05:31 -05:00
Thomas Weber bf7ae82d75 Merge pull request #290 from Tacodiva/compiler-int-type-fix
Make types for blocks which return ints more specific
2025-09-27 22:09:49 -05:00
Thomas Weber 7051b87b21 Merge pull request #289 from Tacodiva/compiler-sensing-sizeof-fix
Fix incorrect type in sensing () of () block
2025-09-27 22:09:18 -05:00
Tacodiva 8fe321c357 Make types for blocks which returns ints more spercific 2025-09-28 12:30:32 +10:00
Tacodiva bc9a3d03b1 Fix sensing x/y of types 2025-09-28 12:29:50 +10:00
Tacodiva bbfa559972 Fix sensing size of type 2025-09-28 12:22:03 +10:00
Thomas Weber 37c6fbe63b Merge pull request #284 from TurboWarp/fix-281
Discard old state after calling yielding procedure
2025-09-24 16:52:50 -05:00
Thomas Weber 2244b26773 Discard old state after calling yielding procedure 2025-09-24 16:48:01 -05:00
Thomas Weber d7a5f1c011 Merge pull request #279
More misc compiler fixes
2025-09-22 19:48:55 -05:00
Thomas Weber e81319b201 Use Object.create(null) instead of {}
Avoids any weird issues if variables have strange IDs like "toString"
2025-09-22 19:35:06 -05:00
Thomas Weber 4a8a5ad901 Add test case for 7ed29f5801 2025-09-22 19:30:23 -05:00
Thomas Weber 214b86a063 Add test case for d8c73c71d2 2025-09-22 19:29:06 -05:00
Thomas Weber 445a129939 Add test case for 7cc8f580b3 2025-09-22 19:28:17 -05:00
Thomas Weber c372e925a5 Add test case for 6a37fee386 2025-09-22 19:27:08 -05:00
Thomas Weber 5a90e13981 Fix TypeState#after setting variable types to undefined
If a variable existed in `this` but not in `other`, its resulting type
would be set to undefined. Changing it to use the type from `this`
seems to fix https://github.com/TurboWarp/scratch-vm/issues/273.
2025-09-22 18:41:48 -05:00
Thomas Weber 40715dc259 Add test case for https://github.com/TurboWarp/scratch-vm/issues/276 2025-09-22 18:41:48 -05:00
Thomas Weber 2639653647 Revert "Fix #273"
This reverts commit c16be25178.

Caused https://github.com/TurboWarp/scratch-vm/issues/276
2025-09-22 18:41:38 -05:00
Thomas Weber 5d917cca05 Use log.error instead of console.error 2025-09-22 18:41:08 -05:00
Thomas Weber 44e2589e65 Fix https://github.com/TurboWarp/scratch-vm/issues/277
Need to clear the state before analyzing the condition as the condition
may be re-evaluated after yielding.
2025-09-22 18:40:34 -05:00
Thomas Weber 41af457060 Move analyzeStackBlock analyzeInputs call into the switch statement
Makes later commits easier.
2025-09-22 18:40:19 -05:00
Thomas Weber 7de26c95b8 Merge pull request #275 from Tacodiva/misc-compiler-fixes
Misc compiler fixes
2025-09-21 09:51:24 -05:00
Tacodiva d17ceccd83 Fix #269 2025-09-21 23:13:11 +10:00
Tacodiva 749e923378 Fix #272 (thanks @Geotale) 2025-09-21 23:10:50 +10:00
Tacodiva c16be25178 Fix #273 2025-09-21 22:59:56 +10:00
Tacodiva cc96ee8c70 Fix -0 being turned into 0 in the type matrix test 2025-09-21 22:59:06 +10:00
Thomas Weber cd353ca31e Merge pull request #268 from TurboWarp/fix-analyzeLoopedBlock-infinite-loop
Give up analyzing looped stack after 10000 iterations
2025-09-20 13:57:52 -05:00
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
Tacodiva cc3375c1aa Merge pull request #265 from TurboWarp/fix-turn-cast
Fix motion_turnleft and motion_turnright missing type casts
2025-09-16 18:14:47 +10:00
Thomas Weber 5b027b995e Fix motion_turnleft and motion_turnright missing type casts 2025-09-15 18:01:45 -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