components/blockly-src/blocks/procedures.js
function() {
    for (var i = 0; i < this.arguments_.length; i++) {
      var field = this.getField('ARGNAME' + i);
      if (field) {
        // Ensure argument name is up to date.
        // The argument name field is deterministic based on the mutation,
        // no need to fire a change event.
        Blockly.Events.disable();
        field.setValue(this.arguments_[i]);
        Blockly.Events.enable();
      } else {
        // Add new input.
        field = new Blockly.FieldLabel(this.arguments_[i]);
        var input = this.appendValueInput('ARG' + i)
            .setAlign(Blockly.ALIGN_RIGHT)
            .appendField(field, 'ARGNAME' + i);
        input.init();
      }
    }
    // Remove deleted inputs.
    while (this.getInput('ARG' + i)) {
      this.removeInput('ARG' + i);
      i++;
    }
    // Add 'with:' if there are parameters, remove otherwise.
    var topRow = this.getInput('TOPROW');
    if (topRow) {
      if (this.arguments_.length) {
        if (!this.getField('WITH')) {
          topRow.appendField(Blockly.Msg.PROCEDURES_CALL_BEFORE_PARAMS, 'WITH');
          topRow.init();
        }
      } else {
        if (this.getField('WITH')) {
          topRow.removeField('WITH');
        }
      }
    }
  }
function() {
    for (var i = 0; i < this.arguments_.length; i++) {
      var field = this.getField('ARGNAME' + i);
      if (field) {
        // Ensure argument name is up to date.
        // The argument name field is deterministic based on the mutation,
        // no need to fire a change event.
        Blockly.Events.disable();
        field.setValue(this.arguments_[i]);
        Blockly.Events.enable();
      } else {
        // Add new input.
        field = new Blockly.FieldLabel(this.arguments_[i]);
        var input = this.appendValueInput('ARG' + i)
            .setAlign(Blockly.ALIGN_RIGHT)
            .appendField(field, 'ARGNAME' + i);
        input.init();
      }
    }
    // Remove deleted inputs.
    while (this.getInput('ARG' + i)) {
      this.removeInput('ARG' + i);
      i++;
    }
    // Add 'with:' if there are parameters, remove otherwise.
    var topRow = this.getInput('TOPROW');
    if (topRow) {
      if (this.arguments_.length) {
        if (!this.getField('WITH')) {
          topRow.appendField(Blockly.Msg.PROCEDURES_CALL_BEFORE_PARAMS, 'WITH');
          topRow.init();
        }
      } else {
        if (this.getField('WITH')) {
          topRow.removeField('WITH');
        }
      }
    }
  }
function ( ) { for ( var i = 0 ; i < this . arguments_ . length ; i ++ ) { var field = this . getField ( 'ARGNAME' + i ) ; if ( field ) { // Ensure argument name is up to date. // The argument name field is deterministic based on the mutation, // no need to fire a change event. Blockly . Events . disable ( ) ; field . setValue ( this . arguments_ [ i ] ) ; Blockly . Events . enable ( ) ; } else { // Add new input. field = new Blockly . FieldLabel ( this . arguments_ [ i ] ) ; var input = this . appendValueInput ( 'ARG' + i ) . setAlign ( Blockly . ALIGN_RIGHT ) . appendField ( field , 'ARGNAME' + i ) ; input . init ( ) ; } } // Remove deleted inputs. while ( this . getInput ( 'ARG' + i ) ) { this . removeInput ( 'ARG' + i ) ; i ++ ; } // Add 'with:' if there are parameters, remove otherwise. var topRow = this . getInput ( 'TOPROW' ) ; if ( topRow ) { if ( this . arguments_ . length ) { if ( ! this . getField ( 'WITH' ) ) { topRow . appendField ( Blockly . Msg . PROCEDURES_CALL_BEFORE_PARAMS , 'WITH' ) ; topRow . init ( ) ; } } else { if ( this . getField ( 'WITH' ) ) { topRow . removeField ( 'WITH' ) ; } } } }
Modify this block to have the correct number of arguments.
@private
@this Blockly.Block
Modify this block to have the correct number of arguments .