components/blockly-src/blocks/procedures.js
function() {
    // Check for duplicated arguments.
    var badArg = false;
    var hash = {};
    for (var i = 0; i < this.arguments_.length; i++) {
      if (hash['arg_' + this.arguments_[i].toLowerCase()]) {
        badArg = true;
        break;
      }
      hash['arg_' + this.arguments_[i].toLowerCase()] = true;
    }
    if (badArg) {
      this.setWarningText(Blockly.Msg.PROCEDURES_DEF_DUPLICATE_WARNING);
    } else {
      this.setWarningText(null);
    }
    // Merge the arguments into a human-readable list.
    var paramString = '';
    if (this.arguments_.length) {
      paramString = Blockly.Msg.PROCEDURES_BEFORE_PARAMS +
          ' ' + this.arguments_.join(', ');
    }
    // The params field is deterministic based on the mutation,
    // no need to fire a change event.
    Blockly.Events.disable();
    this.setFieldValue(paramString, 'PARAMS');
    Blockly.Events.enable();
  }
function() {
    // Check for duplicated arguments.
    var badArg = false;
    var hash = {};
    for (var i = 0; i < this.arguments_.length; i++) {
      if (hash['arg_' + this.arguments_[i].toLowerCase()]) {
        badArg = true;
        break;
      }
      hash['arg_' + this.arguments_[i].toLowerCase()] = true;
    }
    if (badArg) {
      this.setWarningText(Blockly.Msg.PROCEDURES_DEF_DUPLICATE_WARNING);
    } else {
      this.setWarningText(null);
    }
    // Merge the arguments into a human-readable list.
    var paramString = '';
    if (this.arguments_.length) {
      paramString = Blockly.Msg.PROCEDURES_BEFORE_PARAMS +
          ' ' + this.arguments_.join(', ');
    }
    // The params field is deterministic based on the mutation,
    // no need to fire a change event.
    Blockly.Events.disable();
    this.setFieldValue(paramString, 'PARAMS');
    Blockly.Events.enable();
  }
function ( ) { // Check for duplicated arguments. var badArg = false ; var hash = { } ; for ( var i = 0 ; i < this . arguments_ . length ; i ++ ) { if ( hash [ 'arg_' + this . arguments_ [ i ] . toLowerCase ( ) ] ) { badArg = true ; break ; } hash [ 'arg_' + this . arguments_ [ i ] . toLowerCase ( ) ] = true ; } if ( badArg ) { this . setWarningText ( Blockly . Msg . PROCEDURES_DEF_DUPLICATE_WARNING ) ; } else { this . setWarningText ( null ) ; } // Merge the arguments into a human-readable list. var paramString = '' ; if ( this . arguments_ . length ) { paramString = Blockly . Msg . PROCEDURES_BEFORE_PARAMS + ' ' + this . arguments_ . join ( ', ' ) ; } // The params field is deterministic based on the mutation, // no need to fire a change event. Blockly . Events . disable ( ) ; this . setFieldValue ( paramString , 'PARAMS' ) ; Blockly . Events . enable ( ) ; }
Update the display of parameters for this procedure definition block.
Display a warning if there are duplicately named parameters.
@private
@this Blockly.Block
Update the display of parameters for this procedure definition block . Display a warning if there are duplicately named parameters .