Skip to content

Commit

Permalink
Added missing semicolons flagged by JSHint.
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuacc committed Sep 28, 2013
1 parent df5486e commit 7df9f6c
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion test/array.selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ $(document).ready(function() {

equal(_.nth(a,0), 'a', 'should return the element at a given index into an array');
equal(_.nth(a,100), undefined, 'should return undefined if out of bounds');
deepEqual(_.map(b,function(e) { return _.nth(e,0) }), ['a','b',undefined], 'should be usable in _.map');
deepEqual(_.map(b,function(e) { return _.nth(e,0); }), ['a','b',undefined], 'should be usable in _.map');
});
});

12 changes: 6 additions & 6 deletions test/collections.walk.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ $(document).ready(function() {
test("circularRefs", function() {
var tree = getSimpleTestTree();
tree.l.l.r = tree;
throws(function() { _.walk.preorder(tree, _.identity) }, TypeError, 'preorder throws an exception');
throws(function() { _.walk.postrder(tree, _.identity) }, TypeError, 'postorder throws an exception');
throws(function() { _.walk.preorder(tree, _.identity); }, TypeError, 'preorder throws an exception');
throws(function() { _.walk.postrder(tree, _.identity); }, TypeError, 'postorder throws an exception');

tree = getSimpleTestTree();
tree.r.l = tree.r;
throws(function() { _.walk.preorder(tree, _.identity) }, TypeError, 'exception for a self-referencing node');
throws(function() { _.walk.preorder(tree, _.identity); }, TypeError, 'exception for a self-referencing node');
});

test("simpleMap", function() {
Expand Down Expand Up @@ -120,11 +120,11 @@ $(document).ready(function() {
});

test("reduce", function() {
var add = function(a, b) { return a + b };
var add = function(a, b) { return a + b; };
var leafMemo = [];
var sum = function(memo, node) {
if (_.isObject(node))
return _.reduce(memo, add, 0)
return _.reduce(memo, add, 0);

strictEqual(memo, leafMemo);
return node;
Expand Down Expand Up @@ -170,7 +170,7 @@ $(document).ready(function() {
tree.r.val = '.oOo.'; // Remove one of the numbers.
var isEvenNumber = function(x) {
return _.isNumber(x) && x % 2 == 0;
}
};

equal(_.walk.filter(tree, _.walk.preorder, _.isObject).length, 7, 'filter objects');
equal(_.walk.filter(tree, _.walk.preorder, _.isNumber).length, 6, 'filter numbers');
Expand Down
4 changes: 2 additions & 2 deletions test/function.arity.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $(document).ready(function() {
var f = function () {
return _.map(arguments, function (arg) {
return typeof arg;
}).join(', ')
}).join(', ');
};
var g = _.fix(f, _, _, 3);
equal(g(1), 'number, undefined, number', 'should fill "undefined" if argument not given');
Expand Down Expand Up @@ -42,7 +42,7 @@ $(document).ready(function() {
function naiveFlip (fun) {
return function () {
return fun.apply(this, reverse(arguments));
}
};
}

function echo (a, b, c) { return [a, b, c]; }
Expand Down
12 changes: 6 additions & 6 deletions test/function.combinators.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ $(document).ready(function() {
function double (n) { return n * 2; }
function plusOne (n) { return n + 1; }

deepEqual(_.mapArgsWith(double, echo)(), [], "should handle the empty case")
deepEqual(_.mapArgsWith(double, echo)(42), [84], "should handle one arg")
deepEqual(_.mapArgsWith(plusOne, echo)(1, 2, 3), [2, 3, 4], "should handle many args")
deepEqual(_.mapArgsWith(double, echo)(), [], "should handle the empty case");
deepEqual(_.mapArgsWith(double, echo)(42), [84], "should handle one arg");
deepEqual(_.mapArgsWith(plusOne, echo)(1, 2, 3), [2, 3, 4], "should handle many args");

deepEqual(_.mapArgsWith(double)(echo)(), [], "should handle the empty case")
deepEqual(_.mapArgsWith(double)(echo)(42), [84], "should handle one arg")
deepEqual(_.mapArgsWith(plusOne)(echo)(1, 2, 3), [2, 3, 4], "should handle many args")
deepEqual(_.mapArgsWith(double)(echo)(), [], "should handle the empty case");
deepEqual(_.mapArgsWith(double)(echo)(42), [84], "should handle one arg");
deepEqual(_.mapArgsWith(plusOne)(echo)(1, 2, 3), [2, 3, 4], "should handle many args");
});

test("flip2", function() {
Expand Down
12 changes: 6 additions & 6 deletions test/function.iterators.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $(document).ready(function() {
function sum (x, y) { return x + y; }
function square (x) { return x * x; }
function odd (x) { return x % 2 === 1; }
function naturalSmallerThan (x) { return _.iterators.List(_.range(0, x)) }
function naturalSmallerThan (x) { return _.iterators.List(_.range(0, x)); }


module("underscore.function.iterators");
Expand All @@ -19,16 +19,16 @@ $(document).ready(function() {
equal(i(), 5, "should return the next element of the underlying array");
equal(i(), undefined, "should return undefined when out of elements");

i = _.iterators.List([1, [2, 3, [4]], 5])
i = _.iterators.List([1, [2, 3, [4]], 5]);
equal(i(), 1, "should return the first element of the underlying array");
notEqual(i(), 2, "should not do a deep traverse");
equal(i(), 5, "should return the next element of the underlying array");
equal(i(), undefined, "should return undefined when out of elements");

i = _.iterators.List([])
i = _.iterators.List([]);
equal(i(), undefined, "should return undefined when there are no elements");

i = _.iterators.List([[], [[]]])
i = _.iterators.List([[], [[]]]);
notEqual(i(), undefined, "should have a values given an empty tree");
});

Expand Down Expand Up @@ -72,7 +72,7 @@ $(document).ready(function() {
});

test("Accumulate", function () {
var i = _.iterators.accumulate(_.iterators.Tree([1, [2, 3, [4]], 5]), sum, 0)
var i = _.iterators.accumulate(_.iterators.Tree([1, [2, 3, [4]], 5]), sum, 0);
equal(i(), 1, "should map an iterator with many elements");
equal(i(), 3, "should map an iterator with many elements");
equal(i(), 6, "should map an iterator with many elements");
Expand All @@ -82,7 +82,7 @@ $(document).ready(function() {

i = _.iterators.accumulate(_.iterators.Tree([[[4], []]]), sum, 42);
equal(i(), 46, "should map an iterator with one element");
equal(i(), undefined)
equal(i(), undefined);

i = _.iterators.accumulate(_.iterators.Tree([[[], []]]), sum, 42);
equal(i(), undefined, "should map an empty iterator");
Expand Down
20 changes: 10 additions & 10 deletions underscore.function.arity.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
}
else throw new RangeError('Only a single argument may be accepted.');

}
};
}

// Curry
Expand Down Expand Up @@ -140,36 +140,36 @@
return enforcesUnary(function (last) {
return fun.call(this, first, last);
});
})
});
},

curry3: function (fun) {
return enforcesUnary(function (first) {
return enforcesUnary(function (second) {
return enforcesUnary(function (last) {
return fun.call(this, first, second, last);
})
})
})
});
});
});
},

// reverse currying for functions taking two arguments.
rcurry2: function (fun) {
return enforcesUnary(function (last) {
return enforcesUnary(function (first) {
return fun.call(this, first, last);
})
})
});
});
},

rcurry3: function (fun) {
return enforcesUnary(function (last) {
return enforcesUnary(function (second) {
return enforcesUnary(function (first) {
return fun.call(this, first, second, last);
})
})
})
});
});
});
},
// Dynamic decorator to enforce function arity and defeat varargs.
enforce: enforce
Expand Down
2 changes: 1 addition & 1 deletion underscore.function.combinators.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
}
else if (funLength === 1) {
return function () {
return fun.call(this, __slice.call(arguments, 0))
return fun.call(this, __slice.call(arguments, 0));
};
}
else {
Expand Down
10 changes: 5 additions & 5 deletions underscore.function.iterators.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
lastIter = null;
return void 0;
}
lastIter = unaryFn.call(gen, gen)
lastIter = unaryFn.call(gen, gen);
}
while (element == null) {
element = lastIter();
Expand All @@ -153,7 +153,7 @@
return void 0;
}
else {
lastIter = unaryFn.call(gen, gen)
lastIter = unaryFn.call(gen, gen);
}
}
}
Expand Down Expand Up @@ -264,7 +264,7 @@
from = from + by;
return was;
}
}
};
};

function downRange (from, to, by) {
Expand Down Expand Up @@ -293,13 +293,13 @@
if (from <= to) {
return upRange(from, to, 1);
}
else return downRange(from, to, 1)
else return downRange(from, to, 1);
}
else if (by > 0) {
return upRange(from, to, by);
}
else if (by < 0) {
return downRange(from, to, Math.abs(by))
return downRange(from, to, Math.abs(by));
}
else return k(from);
};
Expand Down
2 changes: 1 addition & 1 deletion underscore.object.selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
},

omitWhen: function(obj, pred) {
return _.pickWhen(obj, function(e) { return !pred(e)} );
return _.pickWhen(obj, function(e) { return !pred(e); });
}

});
Expand Down
2 changes: 1 addition & 1 deletion underscore.util.strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

// Converts a string to camel case
camelCase : function( string ){
return string.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase() });
return string.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });
},

// Converts camel case to dashed (opposite of _.camelCase)
Expand Down

0 comments on commit 7df9f6c

Please sign in to comment.