From 8c5193502577e5bba1ff25b17b10a5b8c5baa971 Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Fri, 3 Nov 2017 11:56:37 -0700 Subject: [PATCH] More lint for unused variables --- blocks/colour.js | 3 ++- core/block.js | 14 ++++++++++---- core/blockly.js | 3 +++ core/comment.js | 19 ++++++++++++------- core/events.js | 4 +++- core/field_textinput.js | 3 ++- 6 files changed, 32 insertions(+), 14 deletions(-) diff --git a/blocks/colour.js b/blocks/colour.js index 63c8c185c..c5beb6caf 100644 --- a/blocks/colour.js +++ b/blocks/colour.js @@ -107,7 +107,8 @@ Blockly.defineBlocksWithJsonArray([ // BEGIN JSON EXTRACT // Block for blending two colours together. { "type": "colour_blend", - "message0": "%{BKY_COLOUR_BLEND_TITLE} %{BKY_COLOUR_BLEND_COLOUR1} %1 %{BKY_COLOUR_BLEND_COLOUR2} %2 %{BKY_COLOUR_BLEND_RATIO} %3", + "message0": "%{BKY_COLOUR_BLEND_TITLE} %{BKY_COLOUR_BLEND_COLOUR1} " + + "%1 %{BKY_COLOUR_BLEND_COLOUR2} %2 %{BKY_COLOUR_BLEND_RATIO} %3", "args0": [ { "type": "input_value", diff --git a/core/block.js b/core/block.js index 8807cd1ff..11b97f1e6 100644 --- a/core/block.js +++ b/core/block.js @@ -297,7 +297,9 @@ Blockly.Block.prototype.unplug = function(opt_healStack) { * @return {!Array.} Array of connections. * @private */ -Blockly.Block.prototype.getConnections_ = function(all) { +Blockly.Block.prototype.getConnections_ = function( + /* eslint-disable no-unused-vars */ all + /* eslint-enable no-unused-vars */) { var myConnections = []; if (this.outputConnection) { myConnections.push(this.outputConnection); @@ -609,7 +611,7 @@ Blockly.Block.prototype.getColour = function() { */ Blockly.Block.prototype.getHue = function() { return this.hue_; -} +}; /** * Change the colour of a block. @@ -1427,7 +1429,9 @@ Blockly.Block.prototype.setCommentText = function(text) { * @param {string=} opt_id An optional ID for the warning text to be able to * maintain multiple warnings. */ -Blockly.Block.prototype.setWarningText = function(text, opt_id) { +Blockly.Block.prototype.setWarningText = function(text, + /* eslint-disable no-unused-vars */ opt_id + /* eslint-enable no-unused-vars */) { // NOP. }; @@ -1435,7 +1439,9 @@ Blockly.Block.prototype.setWarningText = function(text, opt_id) { * Give this block a mutator dialog. * @param {Blockly.Mutator} mutator A mutator dialog instance or null to remove. */ -Blockly.Block.prototype.setMutator = function(mutator) { +Blockly.Block.prototype.setMutator = function( + /* eslint-disable no-unused-vars */ mutator + /* eslint-enable no-unused-vars */) { // NOP. }; diff --git a/core/blockly.js b/core/blockly.js index 601e98527..973899635 100644 --- a/core/blockly.js +++ b/core/blockly.js @@ -58,7 +58,10 @@ goog.require('goog.userAgent'); // Turn off debugging when compiled. +// Unused within the Blockly library, but used in Closure. +/* eslint-disable no-unused-vars */ var CLOSURE_DEFINES = {'goog.DEBUG': false}; +/* eslint-enable no-unused-vars */ /** * The main workspace most recently used. diff --git a/core/comment.js b/core/comment.js index f0d5f3537..ff56598f4 100644 --- a/core/comment.js +++ b/core/comment.js @@ -70,19 +70,21 @@ Blockly.Comment.prototype.drawIcon_ = function(group) { // Circle. Blockly.utils.createSvgElement('circle', {'class': 'blocklyIconShape', 'r': '8', 'cx': '8', 'cy': '8'}, - group); + group); // Can't use a real '?' text character since different browsers and operating // systems render it differently. // Body of question mark. Blockly.utils.createSvgElement('path', {'class': 'blocklyIconSymbol', - 'd': 'm6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.405 0.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25 -1.201,0.998 -1.201,1.528 -1.204,2.19z'}, - group); + 'd': 'm6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.405' + + '0.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25' + + '-1.201,0.998 -1.201,1.528 -1.204,2.19z'}, + group); // Dot of question mark. Blockly.utils.createSvgElement('rect', {'class': 'blocklyIconSymbol', - 'x': '6.8', 'y': '10.78', 'height': '2', 'width': '2'}, - group); + 'x': '6.8', 'y': '10.78', 'height': '2', 'width': '2'}, + group); }; /** @@ -117,7 +119,9 @@ Blockly.Comment.prototype.createEditor_ = function() { Blockly.bindEventWithChecks_(textarea, 'wheel', this, function(e) { e.stopPropagation(); }); - Blockly.bindEventWithChecks_(textarea, 'change', this, function(e) { + Blockly.bindEventWithChecks_(textarea, 'change', this, function( + /* eslint-disable no-unused-vars */ e + /* eslint-enable no-unused-vars */) { if (this.text_ != textarea.value) { Blockly.Events.fire(new Blockly.Events.BlockChange( this.block_, 'comment', null, this.text_, textarea.value)); @@ -207,7 +211,8 @@ Blockly.Comment.prototype.setVisible = function(visible) { * @param {!Event} e Mouse up event. * @private */ -Blockly.Comment.prototype.textareaFocus_ = function(e) { +Blockly.Comment.prototype.textareaFocus_ = function( + /* eslint-disable no-unused-vars */ e /* eslint-enable no-unused-vars */) { // Ideally this would be hooked to the focus event for the comment. // However doing so in Firefox swallows the cursor for unknown reasons. // So this is hooked to mouseup instead. No big deal. diff --git a/core/events.js b/core/events.js index 72dc05fda..e1ffad6f0 100644 --- a/core/events.js +++ b/core/events.js @@ -428,7 +428,9 @@ Blockly.Events.Abstract.prototype.isNull = function() { * Run an event. * @param {boolean} forward True if run forward, false if run backward (undo). */ -Blockly.Events.Abstract.prototype.run = function(forward) { +Blockly.Events.Abstract.prototype.run = function( + /* eslint-disable no-unused-vars */ forward + /* eslint-enable no-unused-vars */) { // Defined by subclasses. }; diff --git a/core/field_textinput.js b/core/field_textinput.js index 8be3eb5af..d75430288 100644 --- a/core/field_textinput.js +++ b/core/field_textinput.js @@ -258,7 +258,8 @@ Blockly.FieldTextInput.prototype.onHtmlInputKeyDown_ = function(e) { * @param {!Event} e Keyboard event. * @private */ -Blockly.FieldTextInput.prototype.onHtmlInputChange_ = function(e) { +Blockly.FieldTextInput.prototype.onHtmlInputChange_ = function( + /* eslint-disable no-unused-vars */ e /* eslint-enable no-unused-vars */) { var htmlInput = Blockly.FieldTextInput.htmlInput_; // Update source block. var text = htmlInput.value;