mirror of
https://github.com/google/blockly.git
synced 2026-01-04 15:40:08 +01:00
Add prefix/suffix to orphaned value blocks.
Also respect suppressPrefixSuffix on loops when generating prefix/suffix with continue/break blocks.
This commit is contained in:
@@ -180,7 +180,7 @@ Blockly.JavaScript['controls_flow_statements'] = function(block) {
|
||||
if (Blockly.JavaScript.STATEMENT_PREFIX) {
|
||||
var loop = Blockly.Constants.Loops
|
||||
.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN.getSurroundLoop(block);
|
||||
if (loop) {
|
||||
if (loop && !loop.suppressPrefixSuffix) {
|
||||
// Inject loop's statement prefix here since the regular one at the end
|
||||
// of the loop will not get executed if 'continue' is triggered.
|
||||
// In the case of 'break', a prefix is needed due to the loop's suffix.
|
||||
|
||||
Reference in New Issue
Block a user