VariableMap and functions added.

This commit is contained in:
marisaleung
2017-04-25 18:11:21 -07:00
parent 9577e5ddc4
commit d903b5e86b
11 changed files with 982 additions and 106 deletions

View File

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