Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
fffb72b
Upgraded Type Analysis
Tacodiva Jun 16, 2024
d3ed93c
Make tests happy :3
Tacodiva Jun 16, 2024
9d28fcc
Add operator type testing
Tacodiva Jun 16, 2024
71b75aa
Add type assertion checking
Tacodiva Jun 16, 2024
41e8167
Fix snapshot tests falling back to "script" instead of the procedure …
Tacodiva Jun 17, 2024
02806b6
Linty linty code
Tacodiva Jun 17, 2024
1dc9aad
Fix issue when setting variables to InputType.ANY and add test
Tacodiva Jun 25, 2024
1dd7744
Handle colors correctly + more smartly
Tacodiva Jul 3, 2024
177b899
Fix issue when switching to costume with a number name
Tacodiva Jul 3, 2024
a589e57
Fix old and add new unsupported APIs.
Tacodiva Jul 28, 2024
3449160
Linty linty code
Tacodiva Jul 28, 2024
59cc74c
Fix imports :c
Tacodiva Jul 28, 2024
430353b
Re-add JSGenerator.unstable_exports and expose enums as unsupported APIs
Tacodiva Jul 28, 2024
df65b01
Merge branch 'origin/develop' into next-next
Tacodiva Sep 26, 2024
b8defad
Merge remote-tracking branch 'origin/develop' into HEAD
Tacodiva Sep 7, 2025
fbca1bf
Fixed `NaN = 0` wrongly reporting true, and add a test
Tacodiva Sep 8, 2025
6a37fee
Re-analyze loop block inputs after each loop
Tacodiva Sep 8, 2025
d8c73c7
Account for `stop this script` in type analysis and add test
Tacodiva Sep 8, 2025
7cc8f58
Fix yielding loop arguments not re-analyzing
Tacodiva Sep 8, 2025
7ed29f5
Fix sound dropdown playing wrong sound when sounds have a number name
Tacodiva Sep 8, 2025
98df18a
Merge pull request #216 from Tacodiva/next-next
Tacodiva Sep 13, 2025
e1ad53e
Add compatibility layer for extensions relying on old compiler (#264)
GarboMuffin Sep 14, 2025
5b027b9
Fix motion_turnleft and motion_turnright missing type casts
GarboMuffin Sep 15, 2025
cc3375c
Merge pull request #265 from TurboWarp/fix-turn-cast
Tacodiva Sep 16, 2025
fa03554
Give up analyzing looped stack after 10000 iterations
GarboMuffin Sep 20, 2025
cd353ca
Merge pull request #268 from TurboWarp/fix-analyzeLoopedBlock-infinit…
GarboMuffin Sep 20, 2025
cc96ee8
Fix `-0` being turned into `0` in the type matrix test
Tacodiva Sep 21, 2025
c16be25
Fix #273
Tacodiva Sep 21, 2025
749e923
Fix #272 (thanks @Geotale)
Tacodiva Sep 21, 2025
d17cecc
Fix #269
Tacodiva Sep 21, 2025
7de26c9
Merge pull request #275 from Tacodiva/misc-compiler-fixes
GarboMuffin Sep 21, 2025
41af457
Move analyzeStackBlock analyzeInputs call into the switch statement
GarboMuffin Sep 22, 2025
44e2589
Fix https://github.com/TurboWarp/scratch-vm/issues/277
GarboMuffin Sep 22, 2025
5d917cc
Use log.error instead of console.error
GarboMuffin Sep 22, 2025
2639653
Revert "Fix #273"
GarboMuffin Sep 22, 2025
40715dc
Add test case for https://github.com/TurboWarp/scratch-vm/issues/276
GarboMuffin Sep 22, 2025
5a90e13
Fix TypeState#after setting variable types to undefined
GarboMuffin Sep 22, 2025
c372e92
Add test case for 6a37fee3866cb96fbc054009b6b1f31bb9244cf9
GarboMuffin Sep 23, 2025
445a129
Add test case for 7cc8f580b3e15b805ef5b1b441b190392cfcd49b
GarboMuffin Sep 23, 2025
214b86a
Add test case for d8c73c71d255d1a9a6526b1cd7e3da8c077fac89
GarboMuffin Sep 23, 2025
4a8a5ad
Add test case for 7ed29f5801c4ad4399d852bf5b4f19244b13cc5b
GarboMuffin Sep 23, 2025
e81319b
Use Object.create(null) instead of {}
GarboMuffin Sep 23, 2025
d7a5f1c
Merge pull request #279
GarboMuffin Sep 23, 2025
2244b26
Discard old state after calling yielding procedure
GarboMuffin Sep 24, 2025
37c6fbe
Merge pull request #284 from TurboWarp/fix-281
GarboMuffin Sep 24, 2025
bbfa559
Fix sensing size of type
Tacodiva Sep 28, 2025
bc9a3d0
Fix sensing x/y of types
Tacodiva Sep 28, 2025
8fe321c
Make types for blocks which returns ints more spercific
Tacodiva Sep 28, 2025
7051b87
Merge pull request #289 from Tacodiva/compiler-sensing-sizeof-fix
GarboMuffin Sep 28, 2025
bf7ae82
Merge pull request #290 from Tacodiva/compiler-int-type-fix
GarboMuffin Sep 28, 2025
2ac7095
Optimize loops with provably-integer iteration counts
GarboMuffin Oct 5, 2025
a2701ef
Use more specific type for round, floor, ceiling
GarboMuffin Oct 5, 2025
2a2d152
Infinite iteration count can also use simpler condition
GarboMuffin Oct 5, 2025
5c5ff71
Merge pull request #296 from TurboWarp/round-floor-ceil-type
GarboMuffin Oct 5, 2025
51aacba
Merge pull request #295 from TurboWarp/optimize-loops
GarboMuffin Oct 5, 2025
d848fd0
Convert default extension URLs from dict to object
GarboMuffin Oct 7, 2025
4ab2467
Add face sensing to default extension URLs
GarboMuffin Oct 7, 2025
2ee8d6c
Merge pull request #299 from TurboWarp/face-sensing
GarboMuffin Oct 7, 2025
d09f82a
Add new test case that does some simple string operations
GarboMuffin Oct 8, 2025
07309b6
Use more specific type for string length
GarboMuffin Oct 8, 2025
36d4d82
Merge pull request #300 from TurboWarp/fix-string-length-type
GarboMuffin Oct 8, 2025
55674f8
Implement Scratch.external - VM part (#308)
GarboMuffin Oct 19, 2025
475ffd0
Update scratch-translate-extension-languages to 1.0.7
GarboMuffin Nov 2, 2025
92adc76
Merge pull request #313 from TurboWarp/update-languages
GarboMuffin Nov 2, 2025
4187f55
Record which keys the project has used
GarboMuffin Nov 16, 2025
88c1f72
Merge upstream and part one of VM updates
CubesterYT Nov 21, 2025
30aaa6f
fix comments_reporter
CST1229 Nov 21, 2025
6da1c17
fix json_index_of_value (and a double evaluation in it)
CST1229 Nov 21, 2025
c65a385
More double descent fixes and lint fixes
CubesterYT Nov 21, 2025
5fdf9f2
Jwklong made me do it
CubesterYT Dec 2, 2025
bfc3974
Fix object and array inputs on custom blocks
LordCat0 Dec 3, 2025
6df6a52
Merge branch 'next-up' of https://github.com/Nitro-Bolt/scratch-vm in…
LordCat0 Dec 3, 2025
c7929d3
Make lint happy
CubesterYT Dec 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"jszip": "^3.1.5",
"scratch-parser": "github:Nitro-Bolt/scratch-parser#master",
"scratch-sb1-converter": "0.2.7",
"scratch-translate-extension-languages": "0.0.20191118205314",
"scratch-translate-extension-languages": "^1.0.7",
"text-encoding": "0.7.0",
"uuid": "8.3.2",
"worker-loader": "^1.1.1"
Expand Down
5 changes: 4 additions & 1 deletion src/compiler/compat-block-utility.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
// @ts-check

const BlockUtility = require('../engine/block-utility');

class CompatibilityLayerBlockUtility extends BlockUtility {
constructor () {
super();
this._stackFrame = {};
this._startedBranch = null;
}

get stackFrame () {
return this.thread.compatibilityStackFrame;
return this.thread?.compatibilityStackFrame;
}

startBranch (branchNumber, isLoop) {
Expand Down
2 changes: 2 additions & 0 deletions src/compiler/compat-blocks.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @ts-check

/**
* @fileoverview List of blocks to be supported in the compiler compatibility layer.
* This is only for native blocks. Extensions should not be listed here.
Expand Down
10 changes: 8 additions & 2 deletions src/compiler/compile.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
// @ts-check

const {IRGenerator} = require('./irgen');
const {IROptimizer} = require('./iroptimizer');
const JSGenerator = require('./jsgen');

const compile = thread => {
const compile = (/** @type {import("../engine/thread")} */ thread) => {
const irGenerator = new IRGenerator(thread);
const ir = irGenerator.generate();

const irOptimizer = new IROptimizer(ir);
irOptimizer.optimize();

const procedures = {};
const target = thread.target;

const compileScript = script => {
const compileScript = (/** @type {import("./intermediate").IntermediateScript} */ script) => {
if (script.cachedCompileResult) {
return script.cachedCompileResult;
}
Expand Down
Loading
Loading