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 8a4e943b41
commit e1b2f251a0
10 changed files with 107 additions and 54 deletions

View File

@@ -32,7 +32,7 @@ goog.require('Blockly.Python');
Blockly.Python['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) {