Commit ecd1981e authored by 皮皮蟹's avatar 皮皮蟹 Committed by Evan W. Patton

Add default statement for empty variable block (#1391)

Fixes #1390
parent da5227b4
...@@ -136,14 +136,15 @@ Blockly.Yail['local_variable'] = function(block,isExpression) { ...@@ -136,14 +136,15 @@ Blockly.Yail['local_variable'] = function(block,isExpression) {
// [lyn, 01/15/2013] Added to fix bug in local declaration expressions: // [lyn, 01/15/2013] Added to fix bug in local declaration expressions:
if(isExpression){ if(isExpression){
if(!block.getInputTargetBlock("RETURN")){ if(!block.getInputTargetBlock("RETURN")){
code += Blockly.Yail.YAIL_SPACER + "0"; code += Blockly.Yail.YAIL_SPACER + "0";
} else { } else {
code += Blockly.Yail.YAIL_SPACER + Blockly.Yail.valueToCode(block, 'RETURN', Blockly.Yail.ORDER_NONE); code += Blockly.Yail.YAIL_SPACER + Blockly.Yail.valueToCode(block, 'RETURN', Blockly.Yail.ORDER_NONE);
} }
} else { } else {
code += Blockly.Yail.YAIL_SPACER + Blockly.Yail.statementToCode(block, 'STACK', Blockly.Yail.ORDER_NONE); code += Blockly.Yail.YAIL_SPACER +
(Blockly.Yail.statementToCode(block, 'STACK', Blockly.Yail.ORDER_NONE) || Blockly.Yail.YAIL_FALSE);
} }
code += Blockly.Yail.YAIL_SPACER + Blockly.Yail.YAIL_CLOSE_COMBINATION; code += Blockly.Yail.YAIL_SPACER + Blockly.Yail.YAIL_CLOSE_COMBINATION;
if(!isExpression){ if(!isExpression){
return code; return code;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment