fix(boards): 修复xpython下变量名大小写不敏感
This commit is contained in:
@@ -214,18 +214,15 @@ export const lists_zip = {
|
||||
this.setMutator(new Blockly.icons.MutatorIcon(['lists_zip_item'], this));
|
||||
this.setTooltip(Blockly.Msg.MIXLY_PYTHON_LISTS_ZIP_TOOLTIP);
|
||||
},
|
||||
|
||||
mutationToDom: function () {
|
||||
var container = document.createElement('mutation');
|
||||
container.setAttribute('items', this.itemCount_);
|
||||
return container;
|
||||
},
|
||||
|
||||
domToMutation: function (xmlElement) {
|
||||
this.itemCount_ = parseInt(xmlElement.getAttribute('items'), 10);
|
||||
this.updateShape_();
|
||||
},
|
||||
|
||||
decompose: function (workspace) {
|
||||
var containerBlock =
|
||||
workspace.newBlock('lists_zip_container');
|
||||
@@ -239,7 +236,6 @@ export const lists_zip = {
|
||||
}
|
||||
return containerBlock;
|
||||
},
|
||||
|
||||
compose: function (containerBlock) {
|
||||
var itemBlock = containerBlock.getInputTargetBlock('STACK');
|
||||
// Count number of inputs.
|
||||
@@ -260,7 +256,6 @@ export const lists_zip = {
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
saveConnections: function (containerBlock) {
|
||||
var itemBlock = containerBlock.getInputTargetBlock('STACK');
|
||||
var i = 0;
|
||||
@@ -272,7 +267,6 @@ export const lists_zip = {
|
||||
itemBlock.nextConnection.targetBlock();
|
||||
}
|
||||
},
|
||||
|
||||
updateShape_: function () {
|
||||
// Delete everything.
|
||||
if (this.getInput('EMPTY')) {
|
||||
|
||||
@@ -117,7 +117,7 @@ class Names {
|
||||
name = varName;
|
||||
}
|
||||
}
|
||||
var normalized = name.toLowerCase() + '_' + type;
|
||||
var normalized = name + '_' + type;
|
||||
|
||||
var isVarType = type == Variables.NAME_TYPE ||
|
||||
type == Names.DEVELOPER_VARIABLE_TYPE;
|
||||
|
||||
@@ -56,7 +56,7 @@ Variables.allVariables = function (root) {
|
||||
var varName = blockVariables[y];
|
||||
// Variable name may be null if the block is only half-built.
|
||||
if (varName) {
|
||||
variableHash[varName.toLowerCase()] = varName;
|
||||
variableHash[varName] = varName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -215,7 +215,7 @@ Variables.generateUniqueName = function (workspace) {
|
||||
while (!newName) {
|
||||
var inUse = false;
|
||||
for (var i = 0; i < variableList.length; i++) {
|
||||
if (variableList[i].toLowerCase() == potName) {
|
||||
if (variableList[i] == potName) {
|
||||
// This potential name is already used.
|
||||
inUse = true;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user