This commit is contained in:
Neil Fraser
2016-11-18 20:26:56 -08:00
parent 531b6caf5d
commit fbd9276e9c
3 changed files with 9 additions and 8 deletions

View File

@@ -443,8 +443,8 @@ Blockly.Blocks['procedures_mutatorarg'] = {
*/
createNewVar_: function(newText) {
var source = this.sourceBlock_;
if (source && source.workspace && source.workspace.options
&& source.workspace.options.parentWorkspace) {
if (source && source.workspace && source.workspace.options &&
source.workspace.options.parentWorkspace) {
source.workspace.options.parentWorkspace.createVariable(newText);
}
}
@@ -861,13 +861,13 @@ Blockly.Blocks['procedures_ifreturn'] = {
if (block.type == 'procedures_defnoreturn' && this.hasReturnValue_) {
this.removeInput('VALUE');
this.appendDummyInput('VALUE')
.appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN);
.appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN);
this.hasReturnValue_ = false;
} else if (block.type == 'procedures_defreturn' &&
!this.hasReturnValue_) {
this.removeInput('VALUE');
this.appendValueInput('VALUE')
.appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN);
.appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN);
this.hasReturnValue_ = true;
}
this.setWarningText(null);