diff --git a/core/block.js b/core/block.js index df9c37e43..536bed2ff 100644 --- a/core/block.js +++ b/core/block.js @@ -705,6 +705,7 @@ Blockly.Block.prototype.getField = function(name) { /** * Return all variables referenced by this block. * @return {!Array.} List of variable names. + * @package */ Blockly.Block.prototype.getVars = function() { var vars = []; @@ -721,6 +722,7 @@ Blockly.Block.prototype.getVars = function() { /** * Return all variables referenced by this block. * @return {!Array.} List of variable models. + * @package */ Blockly.Block.prototype.getVarModels = function() { var vars = []; @@ -743,7 +745,7 @@ Blockly.Block.prototype.getVarModels = function() { * Notification that a variable is renaming but keeping the same ID. If the * variable is in use on this block, rerender to show the new name. * @param {!Blockly.VariableModel} variable The variable being renamed. - * @public + * @package */ Blockly.Block.prototype.updateVarName = function(variable) { for (var i = 0, input; input = this.inputList[i]; i++) { @@ -758,7 +760,7 @@ Blockly.Block.prototype.updateVarName = function(variable) { /** * Notification that a variable is renaming. - * If the name matches one of this block's variables, rename it. + * If the ID matches one of this block's variables, rename it. * @param {string} oldId ID of variable to rename. * @param {string} newId ID of new variable. May be the same as oldId, but with * an updated name. diff --git a/core/field_variable.js b/core/field_variable.js index 231c095ca..4dec2f075 100644 --- a/core/field_variable.js +++ b/core/field_variable.js @@ -204,8 +204,7 @@ Blockly.FieldVariable.prototype.typeIsAllowed_ = function(type) { * @private */ Blockly.FieldVariable.prototype.getVariableTypes_ = function() { - // TODO: Why does this happen every time, instead of once when the workspace - // is set? Do we expect the variable types to change that much? + // TODO (#1513): Try to avoid calling this every time the field is edited. var variableTypes = this.variableTypes; if (variableTypes === null || variableTypes === undefined) { // If variableTypes is null, return all variable types. diff --git a/core/names.js b/core/names.js index a886e41c5..7b7977290 100644 --- a/core/names.js +++ b/core/names.js @@ -26,14 +26,6 @@ goog.provide('Blockly.Names'); -/** - * Constant to separate developer variable names from user-defined variable - * names when running generators. - * A developer variable will be declared as a global in the generated code, but - * will never be shown to the user in the workspace or stored in the variable - * map. - */ -Blockly.Names.DEVELOPER_VARIABLE_TYPE = 'DEVELOPER_VARIABLE'; /** * Class for a database of entity names (variables, functions, etc). @@ -55,6 +47,15 @@ Blockly.Names = function(reservedWords, opt_variablePrefix) { this.reset(); }; +/** + * Constant to separate developer variable names from user-defined variable + * names when running generators. + * A developer variable will be declared as a global in the generated code, but + * will never be shown to the user in the workspace or stored in the variable + * map. + */ +Blockly.Names.DEVELOPER_VARIABLE_TYPE = 'DEVELOPER_VARIABLE'; + /** * When JavaScript (or most other languages) is generated, variable 'foo' and * procedure 'foo' would collide. However, Blockly has no such problems since