Update vendor/underscore to v1.6.0.

This commit is contained in:
John-David Dalton
2014-02-10 23:00:19 -08:00
parent f090af2292
commit 4b448a877c
13 changed files with 724 additions and 547 deletions

View File

@@ -1,8 +1,8 @@
$(document).ready(function() {
(function() {
module("Chaining");
module('Chaining');
test("map/flatten/reduce", function() {
test('map/flatten/reduce', function() {
var lyrics = [
"I'm a lumberjack and I'm okay",
"I sleep all night and I work all day",
@@ -20,7 +20,7 @@ $(document).ready(function() {
ok(counts.a == 16 && counts.e == 10, 'counted all the letters in the song');
});
test("select/reject/sortBy", function() {
test('select/reject/sortBy', function() {
var numbers = [1,2,3,4,5,6,7,8,9,10];
numbers = _(numbers).chain().select(function(n) {
return n % 2 === 0;
@@ -29,10 +29,10 @@ $(document).ready(function() {
}).sortBy(function(n) {
return -n;
}).value();
equal(numbers.join(', '), "10, 6, 2", "filtered and reversed the numbers");
equal(numbers.join(', '), '10, 6, 2', 'filtered and reversed the numbers');
});
test("select/reject/sortBy in functional style", function() {
test('select/reject/sortBy in functional style', function() {
var numbers = [1,2,3,4,5,6,7,8,9,10];
numbers = _.chain(numbers).select(function(n) {
return n % 2 === 0;
@@ -41,10 +41,10 @@ $(document).ready(function() {
}).sortBy(function(n) {
return -n;
}).value();
equal(numbers.join(', '), "10, 6, 2", "filtered and reversed the numbers");
equal(numbers.join(', '), '10, 6, 2', 'filtered and reversed the numbers');
});
test("reverse/concat/unshift/pop/map", function() {
test('reverse/concat/unshift/pop/map', function() {
var numbers = [1,2,3,4,5];
numbers = _(numbers).chain()
.reverse()
@@ -53,13 +53,13 @@ $(document).ready(function() {
.pop()
.map(function(n){ return n * 2; })
.value();
equal(numbers.join(', '), "34, 10, 8, 6, 4, 2, 10, 10", 'can chain together array functions.');
equal(numbers.join(', '), '34, 10, 8, 6, 4, 2, 10, 10', 'can chain together array functions.');
});
test("chaining works in small stages", function() {
test('chaining works in small stages', function() {
var o = _([1, 2, 3, 4]).chain();
deepEqual(o.filter(function(i) { return i < 3; }).value(), [1, 2]);
deepEqual(o.filter(function(i) { return i > 2; }).value(), [3, 4]);
});
});
})();