components/blockly-src/blocks/logic.js
function(containerBlock) {
    var clauseBlock = containerBlock.nextConnection.targetBlock();
    var i = 1;
    while (clauseBlock) {
      switch (clauseBlock.type) {
        case 'controls_if_elseif':
          var inputIf = this.getInput('IF' + i);
          var inputDo = this.getInput('DO' + i);
          clauseBlock.valueConnection_ =
              inputIf && inputIf.connection.targetConnection;
          clauseBlock.statementConnection_ =
              inputDo && inputDo.connection.targetConnection;
          i++;
          break;
        case 'controls_if_else':
          var inputDo = this.getInput('ELSE');
          clauseBlock.statementConnection_ =
              inputDo && inputDo.connection.targetConnection;
          break;
        default:
          throw 'Unknown block type.';
      }
      clauseBlock = clauseBlock.nextConnection &&
          clauseBlock.nextConnection.targetBlock();
    }
  }
function(containerBlock) {
    var clauseBlock = containerBlock.nextConnection.targetBlock();
    var i = 1;
    while (clauseBlock) {
      switch (clauseBlock.type) {
        case 'controls_if_elseif':
          var inputIf = this.getInput('IF' + i);
          var inputDo = this.getInput('DO' + i);
          clauseBlock.valueConnection_ =
              inputIf && inputIf.connection.targetConnection;
          clauseBlock.statementConnection_ =
              inputDo && inputDo.connection.targetConnection;
          i++;
          break;
        case 'controls_if_else':
          var inputDo = this.getInput('ELSE');
          clauseBlock.statementConnection_ =
              inputDo && inputDo.connection.targetConnection;
          break;
        default:
          throw 'Unknown block type.';
      }
      clauseBlock = clauseBlock.nextConnection &&
          clauseBlock.nextConnection.targetBlock();
    }
  }
function ( containerBlock ) { var clauseBlock = containerBlock . nextConnection . targetBlock ( ) ; var i = 1 ; while ( clauseBlock ) { switch ( clauseBlock . type ) { case 'controls_if_elseif' : var inputIf = this . getInput ( 'IF' + i ) ; var inputDo = this . getInput ( 'DO' + i ) ; clauseBlock . valueConnection_ = inputIf && inputIf . connection . targetConnection ; clauseBlock . statementConnection_ = inputDo && inputDo . connection . targetConnection ; i ++ ; break ; case 'controls_if_else' : var inputDo = this . getInput ( 'ELSE' ) ; clauseBlock . statementConnection_ = inputDo && inputDo . connection . targetConnection ; break ; default : throw 'Unknown block type.' ; } clauseBlock = clauseBlock . nextConnection && clauseBlock . nextConnection . targetBlock ( ) ; } }
Store pointers to any connected child blocks.
@param {!Blockly.Block} containerBlock Root block in mutator.
@this Blockly.Block
Store pointers to any connected child blocks .