chore: fix more lint (#5676)

* chore: fix assorted lint

* chore: clang-format

* chore: clang-format
This commit is contained in:
Rachel Fenichel
2021-11-08 16:41:52 -08:00
committed by GitHub
parent beefe361a3
commit f14a1c8034
30 changed files with 146 additions and 98 deletions

View File

@@ -80,16 +80,16 @@ Blockly.Constants.VariablesDynamic.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MI
customContextMenu: function(options) {
// Getter blocks have the option to create a setter block, and vice versa.
if (!this.isInFlyout) {
let opposite_type;
let oppositeType;
let contextMenuMsg;
const id = this.getFieldValue('VAR');
const variableModel = this.workspace.getVariableById(id);
const varType = variableModel.type;
if (this.type === 'variables_get_dynamic') {
opposite_type = 'variables_set_dynamic';
oppositeType = 'variables_set_dynamic';
contextMenuMsg = Blockly.Msg['VARIABLES_GET_CREATE_SET'];
} else {
opposite_type = 'variables_get_dynamic';
oppositeType = 'variables_get_dynamic';
contextMenuMsg = Blockly.Msg['VARIABLES_SET_CREATE_GET'];
}
@@ -101,7 +101,7 @@ Blockly.Constants.VariablesDynamic.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MI
xmlField.setAttribute('variabletype', varType);
xmlField.appendChild(Blockly.utils.xml.createTextNode(name));
const xmlBlock = Blockly.utils.xml.createElement('block');
xmlBlock.setAttribute('type', opposite_type);
xmlBlock.setAttribute('type', oppositeType);
xmlBlock.appendChild(xmlField);
option.callback = Blockly.ContextMenu.callbackFactory(this, xmlBlock);
options.push(option);