Skip to content
This repository has been archived by the owner on Jan 7, 2018. It is now read-only.

Commit

Permalink
Dealt with lint annoyances
Browse files Browse the repository at this point in the history
  • Loading branch information
twolfson committed Dec 31, 2012
1 parent cc63641 commit 0319648
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions lib/engines/vows.engine.js
Expand Up @@ -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
Expand All @@ -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 =(
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0319648

Please sign in to comment.