Closed towerofnix closed 5 months ago
OK, no, that was a misread of the code. sb3Block.next !== block.next
and ?? undefined
is to coalesce to the parameter interface for BlockBase
. We need to represent sb3's Block.next
, as string | null | undefined
(even though Scratch probably doesn't generate next: undefined
). Probably Block.parent
also for safety. (Or next?: string | null
etc)
Investigating #141.
A simple change in
blockWithNext
to help debug it:Last few messages leading up to error are:
This project doesn't appear to be generated from a normal Scratch editor, i.e. those are extremely short IDs compared to a normal project:
So it's quite possible that the
sb3Block.next === undefined
instead ofnull
like we're checking for is an exemption the minifier or project saver this project was made with took. (Unmodified scratch-vm has no problem loading this.)Still, it seems like this is something we are more or less trying to detect but... not treating appropriately...? Check out a little bit earlier in
blockWithNext
:What's with that
?? undefined
, if we're going to be comparing it againstnull
immediately thereafter? Shouldn't it be?? null
?