diff --git a/blocks/procedures.js b/blocks/procedures.js index 71993b950..263d339e5 100644 --- a/blocks/procedures.js +++ b/blocks/procedures.js @@ -536,7 +536,10 @@ Blockly.Blocks['procedures_callnoreturn'] = { } } // Add 'with:' if there are parameters. - this.getField_('WITH').setVisible(!!this.arguments_.length); + var withField = this.getField_('WITH'); + if (withField) { + withField.setVisible(!!this.arguments_.length); + } // Restore rendering and show the changes. this.rendered = savedRendered; if (this.rendered) { diff --git a/blocks_compressed.js b/blocks_compressed.js index cee5e0234..ca8c96f0a 100644 --- a/blocks_compressed.js +++ b/blocks_compressed.js @@ -105,7 +105,7 @@ Blockly.Blocks.procedures_mutatorarg={init:function(){this.setColour(290);this.a Blockly.Blocks.procedures_callnoreturn={init:function(){this.setHelpUrl(Blockly.Msg.PROCEDURES_CALLNORETURN_HELPURL);this.setColour(290);this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_CALLNORETURN_CALL).appendField("","NAME").appendField(Blockly.Msg.PROCEDURES_CALL_BEFORE_PARAMS,"WITH");this.setPreviousStatement(!0);this.setNextStatement(!0);this.arguments_=[];this.quarkArguments_=this.quarkConnections_=null},getProcedureCall:function(){return this.getFieldValue("NAME")},renameProcedure:function(a, b){Blockly.Names.equals(a,this.getProcedureCall())&&(this.setFieldValue(b,"NAME"),this.setTooltip((this.outputConnection?Blockly.Msg.PROCEDURES_CALLRETURN_TOOLTIP:Blockly.Msg.PROCEDURES_CALLNORETURN_TOOLTIP).replace("%1",b)))},setProcedureParameters:function(a,b){if(b){if(b.length!=a.length)throw"Error: paramNames and paramIds must be the same length.";this.quarkArguments_||(this.quarkConnections_={},a.join("\n")==this.arguments_.join("\n")?this.quarkArguments_=b:this.quarkArguments_=[]);var c=this.rendered; this.rendered=!1;for(var d=this.arguments_.length-1;0<=d;d--){var e=this.getInput("ARG"+d);if(e){var f=e.connection.targetConnection;this.quarkConnections_[this.quarkArguments_[d]]=f;this.removeInput("ARG"+d)}}this.arguments_=[].concat(a);this.quarkArguments_=b;for(d=0;d