Skip to content

Commit afb4e83

Browse files
committed
Merge branch 'develop' of https://github.com/TurboWarp/scratch-vm into TurboWarp-develop
2 parents 797ee66 + 92adc76 commit afb4e83

File tree

133 files changed

+4860
-2081
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+4860
-2081
lines changed

.github/workflows/deploy.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ jobs:
1313
build:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
16+
- uses: actions/checkout@v4
1717
with:
1818
persist-credentials: false
1919
- name: Install Node.js
20-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
20+
uses: actions/setup-node@v4
2121
with:
22-
node-version: 20
23-
cache: npm
22+
node-version: 22
2423
- name: Install dependencies
2524
run: npm ci
2625
- name: Build playground
@@ -31,7 +30,7 @@ jobs:
3130
# It will still generate what it can, so it's safe to ignore the error
3231
continue-on-error: true
3332
- name: Upload artifact
34-
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa
33+
uses: actions/upload-pages-artifact@v3
3534
with:
3635
path: ./playground/
3736

@@ -47,4 +46,4 @@ jobs:
4746
steps:
4847
- name: Deploy to GitHub Pages
4948
id: deployment
50-
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e
49+
uses: actions/deploy-pages@v4

.github/workflows/node.js.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ jobs:
88
build:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
11+
- uses: actions/checkout@v4
1212
with:
1313
persist-credentials: false
1414
- name: Install Node.js
15-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
15+
uses: actions/setup-node@v4
1616
with:
17-
node-version: 20
17+
node-version: 22
1818
cache: npm
1919
- run: npm ci
2020
- run: npm run lint
2121
- run: npm run build
22-
- run: npm run test
22+
- run: npm run tap

package-lock.json

Lines changed: 13 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"immutable": "3.8.2",
5050
"scratch-parser": "github:TurboWarp/scratch-parser#master",
5151
"scratch-sb1-converter": "0.2.7",
52-
"scratch-translate-extension-languages": "0.0.20191118205314",
52+
"scratch-translate-extension-languages": "^1.0.7",
5353
"text-encoding": "0.7.0",
5454
"uuid": "8.3.2",
5555
"worker-loader": "^1.1.1"

src/compiler/compat-block-utility.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1+
// @ts-check
2+
13
const BlockUtility = require('../engine/block-utility');
24

35
class CompatibilityLayerBlockUtility extends BlockUtility {
46
constructor () {
57
super();
8+
this._stackFrame = {};
69
this._startedBranch = null;
710
}
811

912
get stackFrame () {
10-
return this.thread.compatibilityStackFrame;
13+
return this.thread?.compatibilityStackFrame;
1114
}
1215

1316
startBranch (branchNumber, isLoop) {

src/compiler/compat-blocks.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// @ts-check
2+
13
/**
24
* @fileoverview List of blocks to be supported in the compiler compatibility layer.
35
* This is only for native blocks. Extensions should not be listed here.

src/compiler/compile.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1+
// @ts-check
2+
13
const {IRGenerator} = require('./irgen');
4+
const {IROptimizer} = require('./iroptimizer');
25
const JSGenerator = require('./jsgen');
36

4-
const compile = thread => {
7+
const compile = (/** @type {import("../engine/thread")} */ thread) => {
58
const irGenerator = new IRGenerator(thread);
69
const ir = irGenerator.generate();
710

11+
const irOptimizer = new IROptimizer(ir);
12+
irOptimizer.optimize();
13+
814
const procedures = {};
915
const target = thread.target;
1016

11-
const compileScript = script => {
17+
const compileScript = (/** @type {import("./intermediate").IntermediateScript} */ script) => {
1218
if (script.cachedCompileResult) {
1319
return script.cachedCompileResult;
1420
}

0 commit comments

Comments
 (0)