mirror of
https://github.com/google/blockly.git
synced 2026-01-09 01:50:11 +01:00
Fix #1538
This commit is contained in:
@@ -165,8 +165,8 @@ Blockly.JavaScript.init = function(workspace) {
|
||||
Blockly.Names.DEVELOPER_VARIABLE_TYPE));
|
||||
}
|
||||
|
||||
// Add user variables.
|
||||
var variables = workspace.getAllVariables();
|
||||
// Add user variables, but only ones that are being used.
|
||||
var variables = Blockly.Variables.allUsedVarModels(workspace);
|
||||
for (var i = 0; i < variables.length; i++) {
|
||||
defvars.push(Blockly.JavaScript.variableDB_.getName(variables[i].getId(),
|
||||
Blockly.Variables.NAME_TYPE));
|
||||
|
||||
Reference in New Issue
Block a user