-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Library blocks unjustifiably assume certain blocks are instances of BlockSvg #6905
Copy link
Copy link
Open
Labels
component: library blocksinternalExternal contributions not acceptedExternal contributions not acceptedissue: bugDescribes why the code or behaviour is wrongDescribes why the code or behaviour is wrong
Description
Check for duplicates
- I have searched for similar issues before opening a new one.
Description
There are several places where library blocks make assumptions that certain Block values are BlockSvg instances.
In some cases these assumptions might be justified—for example, block types that are intended to be used only in mutators will normally be BlockSvg instances—but is risky and prevents those blocks from being safely instantiated in headless mode.
In blocks/lists.ts
lists_create_with:initmethod callsnew Mutator(/*...*/, this).decomposemethod callsworkspace.newBlock('lists_create_with_container').initSvg()andworkspace.newBlock('lists_create_with_item').initSvg().
Reproduction steps
These are theoretical / type safety issues; I have not verified if it's actually possible to cause a crash.
Additional Info
Part of #6920.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
component: library blocksinternalExternal contributions not acceptedExternal contributions not acceptedissue: bugDescribes why the code or behaviour is wrongDescribes why the code or behaviour is wrong