The special key name list is now a set instead of an array.
In the most common case of a simple letter, a search is skipped entirely.
Test coverage already exists.
The behavior is non-trivial as it will keep running the old thread
unti it yields.
I briefly tested putting `thread.status = 4` at the start of _restartThread
and all the old execution tests still passed, so let's just add a bit more
coverage. This was nearly regressed by f548d1b33c.
This check only makes sense if isKilled === true implies that it was already
removed from threads, however that is not the case in the VM itself and
especially in some extensions.
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>
"stop this script" and "return" would previously cause all the procedure
arguments to be re-evaluated and then discarded. In vanilla Scratch the
worst case is a performance penalty, but with our custom reporters it
can cause infinite loops.
Fixes https://github.com/TurboWarp/scratch-vm/issues/201
The GPL family of licenses are not perfect. Notably they are incompatible with
the SIL OFL 1.1 used by the fonts in scratch-render-fonts. In the packager we
'statically link' all of this those fonts into one HTML file. Is that legal?
Seems like you can make an argument that it's not. Who knows. I'm not a lawyer.
MPL 2.0 is a good alternative: It's still copyleft, used by real projects,
backed by a real organization, and GPL compatible.
Before 9a4afe2864 all changes were either by me
or under BSD3c. The only third-party LGPL commit is b6c42081b0
which is trivial if any copyright dispute should arise. Thus we can make this
switch.
Related: https://github.com/TurboWarp/scratch-gui/pull/909
something went wrong on the original merge, and we didn't actually
bring in all the old commits. with this we should have all the commits
brought into our tree with no actual changes as we already did the
merge.