From 268a83d054a0c62e6a67a0b5062c037237cb1dda Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Mon, 19 Jul 2021 13:40:05 -0700 Subject: [PATCH] Address PR comments --- core/utils/toolbox.js | 8 ++++---- tests/deps.js | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/core/utils/toolbox.js b/core/utils/toolbox.js index ec050d178..aab51d826 100644 --- a/core/utils/toolbox.js +++ b/core/utils/toolbox.js @@ -17,7 +17,7 @@ goog.module('Blockly.utils.toolbox'); goog.module.declareLegacyNamespace(); -const {IE} = goog.require('Blockly.utils.userAgent'); +const userAgent = goog.require('Blockly.utils.userAgent'); const {textToDom} = goog.require('Blockly.Xml'); const {CssConfig: CategoryCssConfig} = goog.requireType('Blockly.ToolboxCategory'); @@ -273,7 +273,7 @@ const hasCategories = function(toolboxJson) { return false; } - let toolboxKind = toolboxJson['kind']; + const toolboxKind = toolboxJson['kind']; if (toolboxKind) { return toolboxKind == CATEGORY_TOOLBOX_KIND; } @@ -387,7 +387,7 @@ const addAttributes = function(node, obj) { const parseToolboxTree = function(toolboxDef) { if (toolboxDef) { if (typeof toolboxDef != 'string') { - if (IE && toolboxDef.outerHTML) { + if (userAgent.IE && toolboxDef.outerHTML) { // In this case the tree will not have been properly built by the // browser. The HTML will be contained in the element, but it will // not have the proper DOM structure since the browser doesn't support @@ -430,4 +430,4 @@ exports = { hasCategories, isCategoryCollapsible, parseToolboxTree -} +}; diff --git a/tests/deps.js b/tests/deps.js index 3d4531cf1..00ce56da3 100644 --- a/tests/deps.js +++ b/tests/deps.js @@ -4,7 +4,6 @@ goog.addDependency('../../blocks/logic.js', ['Blockly.Blocks.logic', 'Blockly.Co goog.addDependency('../../blocks/loops.js', ['Blockly.Blocks.loops', 'Blockly.Constants.Loops'], ['Blockly', 'Blockly.Blocks', 'Blockly.FieldDropdown', 'Blockly.FieldLabel', 'Blockly.FieldNumber', 'Blockly.FieldVariable', 'Blockly.Warning']); goog.addDependency('../../blocks/math.js', ['Blockly.Blocks.math', 'Blockly.Constants.Math'], ['Blockly', 'Blockly.Blocks', 'Blockly.FieldDropdown', 'Blockly.FieldLabel', 'Blockly.FieldNumber', 'Blockly.FieldVariable']); goog.addDependency('../../blocks/procedures.js', ['Blockly.Blocks.procedures'], ['Blockly', 'Blockly.Blocks', 'Blockly.Comment', 'Blockly.FieldCheckbox', 'Blockly.FieldLabel', 'Blockly.FieldTextInput', 'Blockly.Mutator', 'Blockly.Warning'], {'lang': 'es5'}); -goog.addDependency('../../blocks/test_blocks.js', ['Blockly.TestBlocks'], ['Blockly', 'Blockly.Blocks'], {'lang': 'es5'}); goog.addDependency('../../blocks/text.js', ['Blockly.Blocks.texts', 'Blockly.Constants.Text'], ['Blockly', 'Blockly.Blocks', 'Blockly.FieldDropdown', 'Blockly.FieldImage', 'Blockly.FieldMultilineInput', 'Blockly.FieldTextInput', 'Blockly.FieldVariable', 'Blockly.Mutator']); goog.addDependency('../../blocks/variables.js', ['Blockly.Blocks.variables', 'Blockly.Constants.Variables'], ['Blockly', 'Blockly.Blocks', 'Blockly.FieldLabel', 'Blockly.FieldVariable']); goog.addDependency('../../blocks/variables_dynamic.js', ['Blockly.Constants.VariablesDynamic'], ['Blockly', 'Blockly.Blocks', 'Blockly.FieldLabel', 'Blockly.FieldVariable']);