-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Open
Labels
carryoverissue: 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
We've recently upgraded from v10x to v12.3.0 and noticed strange behavior with our json generation logic. Our json generator for procedures_defreturn uses the following:
const branch = generator.statementToCode(block, "STACK");
statementToCode no longer continues after it encounters a disabled statement and it ignores any enabled statements that come after that. I could not find anything in the release notice documenting this change. Below is a simple example to replicate the issue:
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="st;R3Gv?hZO%gen/D,DD\">test</variable></variables><block type="procedures_defreturn" id="X9dKT|eT3]ebKyUClC6f" deletable="false" editable="false" x="350" y="150"><field name="NAME">test</field><comment pinned="false" h="80" w="160">Describe this function...</comment><statement name="STACK"><block type="controls_if" id="0`5}e{BBT{nYvzo}ORJW" disabled-reasons="user%20action"><next><block type="variables_set_dynamic" id="^^vGa8uiHh`4*49qXGhL"><field name="VAR" id="st;R3Gv?hZO%gen/D,DD">test</field><value name="VALUE"><block type="text" id="^(nef#JuKjwP7*wW-d%("><field name="TEXT"></field></block></value></block></next></block></statement><value name="RETURN"><block type="text" id="(krxy}_(hXRVy8%f8.^g"><field name="TEXT"></field></block></value></block></xml>
Reproduction steps
- Create a workspace with a procedures_defreturn block and define a custom json generator, add 2 statements and disable the first.
- Call generator.statementToCode(block, "STACK"); in the json generator.
- Notice the second statement is ommited from the final output.
Stack trace
Screenshots
No response
Browsers
No response
bhanuprakash026, IsaacPerigord, semlichasa, stefan-stanca and periperidev
Metadata
Metadata
Assignees
Labels
carryoverissue: bugDescribes why the code or behaviour is wrongDescribes why the code or behaviour is wrong
Type
Projects
Status
Todo