Skip to content

Commit 5f53caf

Browse files
committed
Added ability to run settrace/ulab variants
1 parent 19bada6 commit 5f53caf

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

docs/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

esm/interpreter/micropython.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,19 @@ export default {
3535
stderr: buffered(console.error),
3636
stdout: buffered(console.log),
3737
});
38+
39+
// ordered extra variants: settrace, settrace-ulab, ulab
40+
const variants = [];
41+
if (config.debug) variants.push('settrace');
42+
if (config.packages?.contains('ulab')) {
43+
config.packages.splice(config.packages.indexOf('ulab'), 1);
44+
variants.push('ulab');
45+
}
46+
3847
url = url.replace(/\.m?js$/, '.wasm');
48+
for (const variant of variants)
49+
url = url.replace(/\.wasm$/, `-${variant}.wasm`);
50+
3951
progress('Loading MicroPython');
4052
const interpreter = await get(loadMicroPython({ linebuffer: false, stderr, stdout, url }));
4153
globalThis[js_modules].set('-T-', this.transform.bind(this, interpreter));

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,6 @@
9898
"to-json-callback": "^0.1.1"
9999
},
100100
"worker": {
101-
"blob": "sha256-wV2VvqA0udjI0o18pxqLaV8Msd4TO1+sLwVPI/cTD+s="
101+
"blob": "sha256-YSJ+QOl5RDBUpjQi5uA0exQN3+l8EszNpTYRHYYhYlk="
102102
}
103103
}

0 commit comments

Comments
 (0)