From 7a5580b3d39a31923dd7f09b9ba25a0c5328b517 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Sat, 8 Aug 2015 15:15:58 -0700 Subject: [PATCH] Minor lints from PR 150. --- blocks/lists.js | 6 ++---- blocks/text.js | 6 ++---- package.json | 10 +++++----- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/blocks/lists.js b/blocks/lists.js index 88a475202..8f63cc1e0 100644 --- a/blocks/lists.js +++ b/blocks/lists.js @@ -110,14 +110,12 @@ Blockly.Blocks['lists_create_with'] = { var itemBlock = containerBlock.getInputTargetBlock('STACK'); // Count number of inputs. var connections = []; - var i = 0; while (itemBlock) { - connections[i] = itemBlock.valueConnection_; + connections.push(itemBlock.valueConnection_); itemBlock = itemBlock.nextConnection && itemBlock.nextConnection.targetBlock(); - i++; } - this.itemCount_ = i; + this.itemCount_ = connections.length; this.updateShape_(); // Reconnect any child blocks. for (var i = 0; i < this.itemCount_; i++) { diff --git a/blocks/text.js b/blocks/text.js index 405e7aeb1..9dac6b2ce 100644 --- a/blocks/text.js +++ b/blocks/text.js @@ -127,14 +127,12 @@ Blockly.Blocks['text_join'] = { var itemBlock = containerBlock.getInputTargetBlock('STACK'); // Count number of inputs. var connections = []; - var i = 0; while (itemBlock) { - connections[i] = itemBlock.valueConnection_; + connections.push(itemBlock.valueConnection_); itemBlock = itemBlock.nextConnection && itemBlock.nextConnection.targetBlock(); - i++; } - this.itemCount_ = i; + this.itemCount_ = connections.length; this.updateShape_(); // Reconnect any child blocks. for (var i = 0; i < this.itemCount_; i++) { diff --git a/package.json b/package.json index fb0d4a234..6eba03ab2 100644 --- a/package.json +++ b/package.json @@ -23,10 +23,10 @@ "jshint": "latest" }, "jshintConfig": { - "unused": true, - "undef": true, - "globalstrict": true, - "sub": true, - "predef": ["Blockly", "goog", "window", "document", "soy", "XMLHttpRequest"] + "globalstrict": true, + "predef": ["Blockly", "goog", "window", "document", "soy", "XMLHttpRequest"], + "sub": true, + "undef": true, + "unused": true } }