mirror of
https://github.com/google/blockly.git
synced 2026-01-06 16:40:07 +01:00
Resolve 13 warnings
Reduce count from 632 to 619. Eliminate copy-paste code duplication in Field.prototype.setValue
This commit is contained in:
@@ -468,7 +468,7 @@ Blockly.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN = {
|
||||
i++;
|
||||
}
|
||||
// Rebuild block.
|
||||
for (var i = 1; i <= this.elseifCount_; i++) {
|
||||
for (i = 1; i <= this.elseifCount_; i++) {
|
||||
this.appendValueInput('IF' + i)
|
||||
.setCheck('Boolean')
|
||||
.appendField(Blockly.Msg['CONTROLS_IF_MSG_ELSEIF']);
|
||||
|
||||
@@ -372,17 +372,18 @@ Blockly.Blocks['procedures_defnoreturn'] = {
|
||||
// Add options to create getters for each parameter.
|
||||
if (!this.isCollapsed()) {
|
||||
for (var i = 0; i < this.argumentVarModels_.length; i++) {
|
||||
var option = {enabled: true};
|
||||
var argOption = {enabled: true};
|
||||
var argVar = this.argumentVarModels_[i];
|
||||
var name = argVar.name;
|
||||
option.text = Blockly.Msg['VARIABLES_SET_CREATE_GET'].replace('%1', name);
|
||||
argOption.text = Blockly.Msg['VARIABLES_SET_CREATE_GET']
|
||||
.replace('%1', argVar.name);
|
||||
|
||||
var xmlField = Blockly.Variables.generateVariableFieldDom(argVar);
|
||||
var xmlBlock = document.createElement('block');
|
||||
xmlBlock.setAttribute('type', 'variables_get');
|
||||
xmlBlock.appendChild(xmlField);
|
||||
option.callback = Blockly.ContextMenu.callbackFactory(this, xmlBlock);
|
||||
options.push(option);
|
||||
var argXmlField = Blockly.Variables.generateVariableFieldDom(argVar);
|
||||
var argXmlBlock = document.createElement('block');
|
||||
argXmlBlock.setAttribute('type', 'variables_get');
|
||||
argXmlBlock.appendChild(argXmlField);
|
||||
argOption.callback =
|
||||
Blockly.ContextMenu.callbackFactory(this, argXmlBlock);
|
||||
options.push(argOption);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user