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;