mirror of
https://github.com/google/blockly.git
synced 2026-01-06 00:20:37 +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:
@@ -139,7 +139,7 @@ Blockly.Lua['lists_getIndex'] = function(block) {
|
||||
var atOrder = (where == 'FROM_END') ? Blockly.Lua.ORDER_ADDITIVE :
|
||||
Blockly.Lua.ORDER_NONE;
|
||||
var at = Blockly.Lua.valueToCode(block, 'AT', atOrder) || '1';
|
||||
var listVar = Blockly.Lua.variableDB_.getDistinctName(
|
||||
var listVar = Blockly.Lua.nameDB_.getDistinctName(
|
||||
'tmp_list', Blockly.VARIABLE_CATEGORY_NAME);
|
||||
at = getIndex_(listVar, where, at);
|
||||
var code = listVar + ' = ' + list + '\n' +
|
||||
@@ -218,7 +218,7 @@ Blockly.Lua['lists_setIndex'] = function(block) {
|
||||
!list.match(/^\w+$/)) {
|
||||
// `list` is an expression, so we may not evaluate it more than once.
|
||||
// We can use multiple statements.
|
||||
var listVar = Blockly.Lua.variableDB_.getDistinctName(
|
||||
var listVar = Blockly.Lua.nameDB_.getDistinctName(
|
||||
'tmp_list', Blockly.VARIABLE_CATEGORY_NAME);
|
||||
code = listVar + ' = ' + list + '\n';
|
||||
list = listVar;
|
||||
|
||||
Reference in New Issue
Block a user