Merge pull request #1707 from google/rachel-fenichel-patch-2

Get rid of variable redeclaration
This commit is contained in:
Rachel Fenichel
2018-03-15 13:57:22 -07:00
committed by GitHub

View File

@@ -291,15 +291,14 @@ Blockly.FieldVariable.dropdownCreate = function() {
throw new Error('Tried to call dropdownCreate on a variable field with no' +
' variable selected.');
}
var variableModelList = [];
var name = this.getText();
var workspace = null;
if (this.sourceBlock_) {
workspace = this.sourceBlock_.workspace;
}
var variableModelList = [];
if (workspace) {
var variableTypes = this.getVariableTypes_();
var variableModelList = [];
// Get a copy of the list, so that adding rename and new variable options
// doesn't modify the workspace's list.
for (var i = 0; i < variableTypes.length; i++) {