Resolve 13 warnings

Reduce count from 632 to 619.
Eliminate copy-paste code duplication in Field.prototype.setValue
This commit is contained in:
Neil Fraser
2019-06-11 21:12:29 -07:00
committed by Neil Fraser
parent bf6d621c63
commit b8cbd9e7df
12 changed files with 59 additions and 50 deletions

View File

@@ -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']);

View File

@@ -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);
}
}
},