mirror of
https://github.com/google/blockly.git
synced 2026-01-04 23:50:12 +01:00
Rename variableDB_ to nameDB_
There is significant confusion in names and comments with regards to variables and procedures. `Blockly.Generator.prototype.variableDB_` is a Blockly.Names database, not a variable map. This rename introduces a getter and setter so deprecated references still work. This commit also fixes some comments which are either outright wrong or misleading regarding variable and procedure names.
This commit is contained in:
@@ -207,7 +207,7 @@ Blockly.JavaScript['math_change'] = function(block) {
|
||||
// Add to a variable in place.
|
||||
var argument0 = Blockly.JavaScript.valueToCode(block, 'DELTA',
|
||||
Blockly.JavaScript.ORDER_ADDITION) || '0';
|
||||
var varName = Blockly.JavaScript.variableDB_.getName(
|
||||
var varName = Blockly.JavaScript.nameDB_.getName(
|
||||
block.getFieldValue('VAR'), Blockly.VARIABLE_CATEGORY_NAME);
|
||||
return varName + ' = (typeof ' + varName + ' == \'number\' ? ' + varName +
|
||||
' : 0) + ' + argument0 + ';\n';
|
||||
|
||||
Reference in New Issue
Block a user