rename variableDB to nameDB
rename variableDB_ to nameDB_ as it is deprecated
This commit is contained in:
@@ -121,21 +121,21 @@ Blockly["Arduino"].init = function (workspace) {
|
||||
|
||||
Blockly["Arduino"].variablesInitCode_ = "";
|
||||
|
||||
if (!Blockly["Arduino"].variableDB_) {
|
||||
Blockly["Arduino"].variableDB_ = new Blockly.Names(
|
||||
if (!Blockly["Arduino"].nameDB_) {
|
||||
Blockly["Arduino"].nameDB_ = new Blockly.Names(
|
||||
Blockly["Arduino"].RESERVED_WORDS_
|
||||
);
|
||||
} else {
|
||||
Blockly["Arduino"].variableDB_.reset();
|
||||
Blockly["Arduino"].nameDB_.reset();
|
||||
}
|
||||
|
||||
Blockly["Arduino"].variableDB_.setVariableMap(workspace.getVariableMap());
|
||||
Blockly["Arduino"].nameDB_.setVariableMap(workspace.getVariableMap());
|
||||
|
||||
// We don't have developer variables for now
|
||||
// // Add developer variables (not created or named by the user).
|
||||
// var devVarList = Blockly.Variables.allDeveloperVariables(workspace);
|
||||
// for (var i = 0; i < devVarList.length; i++) {
|
||||
// defvars.push(Blockly['Arduino'].variableDB_.getName(devVarList[i],
|
||||
// defvars.push(Blockly['Arduino'].nameDB_.getName(devVarList[i],
|
||||
// Blockly.Names.DEVELOPER_VARIABLE_TYPE));
|
||||
// }
|
||||
|
||||
@@ -145,7 +145,7 @@ Blockly["Arduino"].init = function (workspace) {
|
||||
for (i = 0; i < doubleVariables.length; i += 1) {
|
||||
variableCode +=
|
||||
"double " +
|
||||
Blockly["Arduino"].variableDB_.getName(
|
||||
Blockly["Arduino"].nameDB_.getName(
|
||||
doubleVariables[i].getId(),
|
||||
Blockly.Variables.NAME_TYPE
|
||||
) +
|
||||
@@ -156,7 +156,7 @@ Blockly["Arduino"].init = function (workspace) {
|
||||
for (i = 0; i < stringVariables.length; i += 1) {
|
||||
variableCode +=
|
||||
"String " +
|
||||
Blockly["Arduino"].variableDB_.getName(
|
||||
Blockly["Arduino"].nameDB_.getName(
|
||||
stringVariables[i].getId(),
|
||||
Blockly.Variables.NAME_TYPE
|
||||
) +
|
||||
@@ -167,7 +167,7 @@ Blockly["Arduino"].init = function (workspace) {
|
||||
for (i = 0; i < booleanVariables.length; i += 1) {
|
||||
variableCode +=
|
||||
"boolean " +
|
||||
Blockly["Arduino"].variableDB_.getDistinctName(
|
||||
Blockly["Arduino"].nameDB_.getDistinctName(
|
||||
booleanVariables[i].getId(),
|
||||
Blockly.Variables.NAME_TYPE
|
||||
) +
|
||||
@@ -178,7 +178,7 @@ Blockly["Arduino"].init = function (workspace) {
|
||||
for (i = 0; i < colourVariables.length; i += 1) {
|
||||
variableCode +=
|
||||
"RGB " +
|
||||
Blockly["Arduino"].variableDB_.getName(
|
||||
Blockly["Arduino"].nameDB_.getName(
|
||||
colourVariables[i].getId(),
|
||||
Blockly.Variables.NAME_TYPE
|
||||
) +
|
||||
@@ -281,7 +281,7 @@ Blockly["Arduino"].finish = function (code) {
|
||||
delete Blockly["Arduino"].loopCodeOnce_;
|
||||
delete Blockly["Arduino"].variablesInitCode_;
|
||||
delete Blockly["Arduino"].libraries_;
|
||||
Blockly["Arduino"].variableDB_.reset();
|
||||
Blockly["Arduino"].nameDB_.reset();
|
||||
|
||||
return code;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user