From 8597c94a49d1506c867692d90b8279b2c325b89a Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Tue, 24 May 2016 15:35:38 -0700 Subject: [PATCH] lint --- blocks/lists.js | 24 +++++++++++++----------- blocks/logic.js | 32 +++++++++++++++++--------------- blocks/procedures.js | 4 ++-- core/block_render_svg.js | 3 ++- 4 files changed, 34 insertions(+), 29 deletions(-) diff --git a/blocks/lists.js b/blocks/lists.js index 301764564..af0f6624a 100644 --- a/blocks/lists.js +++ b/blocks/lists.js @@ -618,17 +618,19 @@ Blockly.Blocks['lists_getSublist'] = { } var menu = new Blockly.FieldDropdown(this['WHERE_OPTIONS_' + n], function(value) { - var newAt = (value == 'FROM_START') || (value == 'FROM_END'); - // The 'isAt' variable is available due to this function being a closure. - if (newAt != isAt) { - var block = this.sourceBlock_; - block.updateAt_(n, newAt); - // This menu has been destroyed and replaced. Update the replacement. - block.setFieldValue(value, 'WHERE' + n); - return null; - } - return undefined; - }); + var newAt = (value == 'FROM_START') || (value == 'FROM_END'); + // The 'isAt' variable is available due to this function being a + // closure. + if (newAt != isAt) { + var block = this.sourceBlock_; + block.updateAt_(n, newAt); + // This menu has been destroyed and replaced. + // Update the replacement. + block.setFieldValue(value, 'WHERE' + n); + return null; + } + return undefined; + }); this.getInput('AT' + n) .appendField(menu, 'WHERE' + n); if (n == 1) { diff --git a/blocks/logic.js b/blocks/logic.js index 5dab77d86..6d34cb14d 100644 --- a/blocks/logic.js +++ b/blocks/logic.js @@ -271,21 +271,23 @@ Blockly.Blocks['logic_compare'] = { * @this Blockly.Block */ init: function() { - var OPERATORS = this.RTL ? [ - ['=', 'EQ'], - ['\u2260', 'NEQ'], - ['>', 'LT'], - ['\u2265', 'LTE'], - ['<', 'GT'], - ['\u2264', 'GTE'] - ] : [ - ['=', 'EQ'], - ['\u2260', 'NEQ'], - ['<', 'LT'], - ['\u2264', 'LTE'], - ['>', 'GT'], - ['\u2265', 'GTE'] - ]; + var rtlOperators = [ + ['=', 'EQ'], + ['\u2260', 'NEQ'], + ['>', 'LT'], + ['\u2265', 'LTE'], + ['<', 'GT'], + ['\u2264', 'GTE'] + ]; + var ltrOperators = [ + ['=', 'EQ'], + ['\u2260', 'NEQ'], + ['<', 'LT'], + ['\u2264', 'LTE'], + ['>', 'GT'], + ['\u2265', 'GTE'] + ]; + var OPERATORS = this.RTL ? rtlOperators : ltrOperators; this.setHelpUrl(Blockly.Msg.LOGIC_COMPARE_HELPURL); this.setColour(Blockly.Blocks.logic.HUE); this.setOutput(true, 'Boolean'); diff --git a/blocks/procedures.js b/blocks/procedures.js index 0b7ad45e2..8e5b68df8 100644 --- a/blocks/procedures.js +++ b/blocks/procedures.js @@ -64,7 +64,7 @@ Blockly.Blocks['procedures_defnoreturn'] = { * inconsistent as a result of the XML loading. * @this Blockly.Block */ - validate: function () { + validate: function() { var name = Blockly.Procedures.findLegalName( this.getFieldValue('NAME'), this); this.setFieldValue(name, 'NAME'); @@ -126,7 +126,7 @@ Blockly.Blocks['procedures_defnoreturn'] = { /** * Create XML to represent the argument inputs. * @param {=boolean} opt_paramIds If true include the IDs of the parameter - * quarks. Used by Blockly.Procedures.mutateCallers for reconnection. + * quarks. Used by Blockly.Procedures.mutateCallers for reconnection. * @return {!Element} XML storage element. * @this Blockly.Block */ diff --git a/core/block_render_svg.js b/core/block_render_svg.js index 7535db4a6..2b60213b5 100644 --- a/core/block_render_svg.js +++ b/core/block_render_svg.js @@ -303,6 +303,7 @@ Blockly.BlockSvg.prototype.render = function(opt_bubble) { */ Blockly.BlockSvg.prototype.renderFields_ = function(fieldList, cursorX, cursorY) { + /* eslint-disable indent */ cursorY += Blockly.BlockSvg.INLINE_PADDING_Y; if (this.RTL) { cursorX = -cursorX; @@ -329,7 +330,7 @@ Blockly.BlockSvg.prototype.renderFields_ = } } return this.RTL ? -cursorX : cursorX; -}; +}; /* eslint-enable indent */ /** * Computes the height and widths for each row and field.