Update procedure generators for PHP and Python to declare developer variables as globals

This commit is contained in:
Rachel Fenichel
2018-01-17 13:04:41 -08:00
parent 3f61f71f35
commit 376b3c4b44
2 changed files with 13 additions and 0 deletions

View File

@@ -43,6 +43,12 @@ Blockly.PHP['procedures_defreturn'] = function(block) {
Blockly.Variables.NAME_TYPE));
}
}
// Add developer variables.
var devVarList = Blockly.Variables.allDeveloperVariables(workspace);
for (var i = 0; i < devVarList.length; i++) {
globals.push(Blockly.PHP.variableDB_.getName(devVarList[i],
Blockly.Names.DEVELOPER_VARIABLE_TYPE));
}
globals = globals.length ? Blockly.PHP.INDENT + 'global ' + globals.join(', ') + ';\n' : '';
var funcName = Blockly.PHP.variableDB_.getName(