mirror of
https://github.com/google/blockly.git
synced 2026-01-05 08:00:09 +01:00
Fixes mutators considering insertion markers during compose (#4449)
* Fix markers for lists, logic, and text * Fix insertion markers in procedure mutators
This commit is contained in:
@@ -176,7 +176,7 @@ Blockly.Blocks['lists_create_with'] = {
|
||||
var itemBlock = containerBlock.getInputTargetBlock('STACK');
|
||||
// Count number of inputs.
|
||||
var connections = [];
|
||||
while (itemBlock) {
|
||||
while (itemBlock && !itemBlock.isInsertionMarker()) {
|
||||
connections.push(itemBlock.valueConnection_);
|
||||
itemBlock = itemBlock.nextConnection &&
|
||||
itemBlock.nextConnection.targetBlock();
|
||||
|
||||
@@ -365,7 +365,7 @@ Blockly.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN = {
|
||||
var valueConnections = [null];
|
||||
var statementConnections = [null];
|
||||
var elseStatementConnection = null;
|
||||
while (clauseBlock) {
|
||||
while (clauseBlock && !clauseBlock.isInsertionMarker()) {
|
||||
switch (clauseBlock.type) {
|
||||
case 'controls_if_elseif':
|
||||
this.elseifCount_++;
|
||||
|
||||
@@ -214,7 +214,7 @@ Blockly.Blocks['procedures_defnoreturn'] = {
|
||||
this.paramIds_ = [];
|
||||
this.argumentVarModels_ = [];
|
||||
var paramBlock = containerBlock.getInputTargetBlock('STACK');
|
||||
while (paramBlock) {
|
||||
while (paramBlock && !paramBlock.isInsertionMarker()) {
|
||||
var varName = paramBlock.getFieldValue('NAME');
|
||||
this.arguments_.push(varName);
|
||||
var variable = this.workspace.getVariable(varName, '');
|
||||
|
||||
@@ -722,7 +722,7 @@ Blockly.Constants.Text.TEXT_JOIN_MUTATOR_MIXIN = {
|
||||
var itemBlock = containerBlock.getInputTargetBlock('STACK');
|
||||
// Count number of inputs.
|
||||
var connections = [];
|
||||
while (itemBlock) {
|
||||
while (itemBlock && !itemBlock.isInsertionMarker()) {
|
||||
connections.push(itemBlock.valueConnection_);
|
||||
itemBlock = itemBlock.nextConnection &&
|
||||
itemBlock.nextConnection.targetBlock();
|
||||
|
||||
Reference in New Issue
Block a user