Our editor relies on the mutation for control_stop to know if there is a connection below.
Spork does not export that mutation anymore.
Instead, we will just generate the mutation to fix errors on loading.
Why:
* We use immutable.js 3.8.2 which is ancient and not getting updates
* immutable.js adds 55KB to the bundle, of which we use almost nothing
* immutable.js's treatment of 0 and -0 is nonsensical and would require weird workarounds like https://github.com/TurboWarp/scratch-vm/pull/320
* We don't benefit from the whole immutability thing
What we're doing instead:
* We have our own MonitorState and MonitorRecord classes
* We track dirty-ness at modification time instead of equality checking every tick
* scratch-gui and packager can continue to think we use immutable.js without causing issues in either direction
* our objects have enough stubs that immutable.js-expecting consumers are ok
* when receiving an object, we check if it looks like an immutable.js one and ask for the plain JS version so that works okay too
Works in command or reporter after yielding or not.
These snippets are covered by the tests:
thread.status = Thread.STATUS_DONE;
thread.status = 4; (indirectly)
sequencer.retireThread(thread);
Before this command:
- Interpreter would popStack() and continue. Inside a loop this was like JS continue, outside it was like return
- Compiler would return literal undefined and keep going.
After this commit:
Both return the error as a string and then continue as normal.
This has several benefits:
- Users can actually see the error messages
- Logical execution flow
- Consistent behavior
- Blocks aren't even supposed to return rejected promises anyways
- No vanilla blocks return rejected promises so no compatibility concerns
Supersedes https://github.com/TurboWarp/scratch-vm/pull/207
- Platform info is now stored in project.json.
- Available to extensions on vm.runtime.platform.
- When loading a project with a different platform, emit an event and wait for callbacks before continuing.
Co-authored-by: Muffin <muffin@muffin.ink>
installs & compiles but has test errors
aside from expected merge conflicts, notable changes from upstream:
- removed husky, commitlint, etc.
- removed semantic-release etc.