mirror of
https://github.com/google/blockly.git
synced 2026-01-09 10:00:09 +01:00
Remove global workspace references from variable and procedure utilities.
This commit is contained in:
@@ -81,10 +81,9 @@ Blockly.Python.ORDER_NONE = 99; // (...)
|
||||
|
||||
/**
|
||||
* Initialise the database of variable names.
|
||||
* @param {Blockly.Workspace=} opt_workspace Workspace to generate code from.
|
||||
* Defaults to main workspace.
|
||||
* @param {!Blockly.Workspace} workspace Workspace to generate code from.
|
||||
*/
|
||||
Blockly.Python.init = function(opt_workspace) {
|
||||
Blockly.Python.init = function(workspace) {
|
||||
// Create a dictionary of definitions to be printed before the code.
|
||||
Blockly.Python.definitions_ = Object.create(null);
|
||||
// Create a dictionary mapping desired function names in definitions_
|
||||
@@ -99,7 +98,7 @@ Blockly.Python.init = function(opt_workspace) {
|
||||
}
|
||||
|
||||
var defvars = [];
|
||||
var variables = Blockly.Variables.allVariables(opt_workspace);
|
||||
var variables = Blockly.Variables.allVariables(workspace);
|
||||
for (var x = 0; x < variables.length; x++) {
|
||||
defvars[x] = Blockly.Python.variableDB_.getName(variables[x],
|
||||
Blockly.Variables.NAME_TYPE) + ' = None';
|
||||
|
||||
Reference in New Issue
Block a user