From 031964898c6bed3c841b277ae674e05990f58fb8 Mon Sep 17 00:00:00 2001 From: Todd Wolfson Date: Mon, 31 Dec 2012 01:14:39 -0800 Subject: [PATCH] Dealt with lint annoyances --- lib/engines/vows.engine.js | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/lib/engines/vows.engine.js b/lib/engines/vows.engine.js index 9cbb1d0..a243133 100644 --- a/lib/engines/vows.engine.js +++ b/lib/engines/vows.engine.js @@ -26,6 +26,13 @@ TestParser.prototype = { // If there is a command if (command) { + // Define variables here to please JSHint + var commandNames, + nodeArr, + lastIndex, + lastNode, + lastName; + // If the node is an object if (typeof node === 'object') { // Add it as a topic @@ -35,11 +42,11 @@ TestParser.prototype = { if (Array.isArray(topic)) { // TODO: Consolidate this with other "if (Array.isArray" section // Convert the names into nodes - var commandNames = topic.map(function (topicObj) { return topicObj.name; }), - nodeArr = namesToNodes(commandNames), - lastIndex = commandNames.length - 1, - lastNode = nodeArr[lastIndex], - lastName = commandNames[lastIndex]; + commandNames = topic.map(function (topicObj) { return topicObj.name; }); + nodeArr = namesToNodes(commandNames); + lastIndex = commandNames.length - 1; + lastNode = nodeArr[lastIndex]; + lastName = commandNames[lastIndex]; // // Displace this node as the leaf node // // TODO: This should work but traverse is giving me shit =( @@ -72,11 +79,11 @@ TestParser.prototype = { // If the command is an array of commands if (Array.isArray(command)) { // Convert the names into nodes - var commandNames = command.map(function (topicObj) { return topicObj.name; }), - nodeArr = namesToNodes(commandNames), - lastIndex = commandNames.length - 1, - lastNode = nodeArr[lastIndex], - lastName = commandNames[lastIndex]; + commandNames = command.map(function (topicObj) { return topicObj.name; }); + nodeArr = namesToNodes(commandNames); + lastIndex = commandNames.length - 1; + lastNode = nodeArr[lastIndex]; + lastName = commandNames[lastIndex]; // Replace leaf with node lastNode[lastName] = node;