Remove some TODOs; add a variable-referencing block to the simple playground flyout

This commit is contained in:
Rachel Fenichel
2018-01-08 14:14:26 -08:00
parent a49a148732
commit 5d6d7519cd
5 changed files with 9 additions and 40 deletions

View File

@@ -737,24 +737,6 @@ Blockly.Block.prototype.getVarModels = function() {
return vars;
};
/**
* Notification that a variable is renaming.
* TODO (#1498): consider deleting this.
* If the name matches one of this block's variables, rename it.
* @param {string} oldName Previous name of variable.
* @param {string} newName Renamed variable.
*/
Blockly.Block.prototype.renameVar = function(oldName, newName) {
for (var i = 0, input; input = this.inputList[i]; i++) {
for (var j = 0, field; field = input.fieldRow[j]; j++) {
if (field instanceof Blockly.FieldVariable &&
Blockly.Names.equals(oldName, field.getValue())) {
field.setValue(newName);
}
}
}
};
/**
* 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.