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 } }