Fix python and php procedures.

This commit is contained in:
marisaleung
2017-06-26 11:51:32 -07:00
parent 997487568d
commit 693bdbb10e
3 changed files with 10 additions and 4 deletions

View File

@@ -33,8 +33,10 @@ Blockly.PHP['procedures_defreturn'] = function(block) {
// First, add a 'global' statement for every variable that is not shadowed by
// a local parameter.
var globals = [];
var varName;
var variables = workspace.getAllVariables();
for (var i = 0, varName; varName = variables[i].name; i++) {
for (var i = 0, variable; variable = variables[i]; i++) {
varName = variable.name;
if (block.arguments_.indexOf(varName) == -1) {
globals.push(Blockly.PHP.variableDB_.getName(varName,
Blockly.Variables.NAME_TYPE));