From 8de5b3ee9f0183a617aa3d161251510670f5d85c Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Thu, 15 Mar 2018 13:04:09 -0700 Subject: [PATCH] Get rid of variable redeclaration --- core/field_variable.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/field_variable.js b/core/field_variable.js index d27666e0d..a494ac411 100644 --- a/core/field_variable.js +++ b/core/field_variable.js @@ -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++) {