Closed 9-2-1 closed 2 years ago
The problem is scripts like this:
Scratch won't convert 1, 2, 3, etc. to numbers, so the list will contain three strings. In TurboWarp it will instead contain three numbers as the compiler will eagerly convert strings to numbers when it's probably safe, which usually improves performance significantly.
In Scratch that script outputs "123", but because of the automatic number conversion, it would instead output "1 2 3" if we used the same logic as Scratch because typeof listItem === 'string'
is not true anymore. The fix was to remove the string type check. This has been found to fix a lot of projects. It breaks projects that do things like "add (1 + 2) to list", but that is much more rare and easier to work around.
Thank you very much.
Is here anyway to disable complier by using comments in the project?
(Maybe you want to say "eagerly convert strings to numbers")
(One of my favourite scratch community use a modified version of TurboWarp's vm and my project went wrong here unfortunately because my project depends on the default behaviour, and I can't disable complier in player mode.)
(Maybe you want to say "eagerly convert strings to numbers")
My bad, yes
Is here anyway to disable complier by using comments in the project?
You have some options:
tw nocompile
to the hat block of the script you don't want compiledThank you very much.
In compiler/jsexecute.js, line 501
Could anyone tell me why there is an "intentional break"?
What will happen if I change it to:
It seems that this change was introduced in commit 20a60d8e1cdb184f988fd01e7ecc88ca8fc98565