Create variable list, and use it for add and rename

This commit is contained in:
Rachel Fenichel
2016-06-22 16:16:31 -07:00
parent 94e0a7ff4c
commit 4a81ecb601
10 changed files with 85 additions and 28 deletions

View File

@@ -31,7 +31,7 @@ goog.require('Blockly.PHP');
Blockly.PHP['procedures_defreturn'] = function(block) {
// Define a procedure with a return value.
// First, add a 'global' statement for every variable that is assigned.
var globals = Blockly.Variables.allVariables(block);
var globals = block.workspace.variableList;
for (var i = globals.length - 1; i >= 0; i--) {
var varName = globals[i];
if (block.arguments_.indexOf(varName) == -1) {