Closed jamesbmadden closed 5 years ago
Swweeeet
A few blocks aren't working, but most reporters are. Any ideas?
https://sheeptester.github.io/scratch-gui/?url=https://nitrocipher.github.io/ext2to3/ext-test.js
Scratch 3 Extensions are run in workers, so things like prompt and alert won't work. I think as long as a worker has access to the APIs the code relies on, then it will work.
I made a simple extension for logging text, errors, and warnings (https://jamesbmadden.github.io/scratch-extensions/log-2.js) and converted it to Scratch 3 and it works fine: https://sheeptester.github.io/scratch-gui/?url=https://jamesbmadden.github.io/scratch-extensions/log.js
I think the only issue is that the APIs for the demo extension are unavailable in workers.
Allow data to be passed from the arguments to the functions without renaming the variables in the functions by setting the argument names to the function's property names.
With this change, reporter blocks should work properly: https://sheeptester.github.io/scratch-gui/?url=https://jamesbmadden.github.io/scratch-extensions/extension-converter-test.js