Commit Graph

143 Commits

Author SHA1 Message Date
Jeremy Ashkenas
7eb7b08f71 reverting a non-important change that broke reduceRight in IE. 2011-07-13 12:58:36 -04:00
Jeremy Ashkenas
779a28d59a Merge branch 'underscore.any' of https://github.com/shinuza/underscore 2011-07-13 12:40:08 -04:00
Jeremy Ashkenas
7573ac7751 Unit tests for sparse arrays. 2011-07-13 12:36:27 -04:00
Jeremy Ashkenas
cd236d4c47 Issue #243. _.functions now also returns the names of function defined in the prototype chain. 2011-07-13 11:09:51 -04:00
Jeremy Ashkenas
0ec859a142 Issue #225, adding _.union, _.difference, to complement _.without and _.intersection. 2011-07-12 16:48:30 -04:00
Florian Friesdorf
9ab3ac44bb move underscore test into a div
more comfortable to include underscore with tests in some other project.
2011-06-25 09:09:55 +02:00
Florian Friesdorf
0202f9f79b make toArray return a clone in case of an array
In combination with backbone this makes coll.toArray() return an array
instead of just returning coll.models, enabling
coll.remove(coll.toArray()) whithout failing half way through.
2011-06-21 18:31:40 +02:00
Jeremy Ashkenas
96dbdaf929 Merge pull request #228 from DmitryBaranovskiy/master
Fixed isEqual and added isObject
2011-06-20 15:50:54 -07:00
Cat Chen
b949d0345f updated _.delay test to use setTimeout to verify _.delay's behavior 2011-06-20 22:30:35 +08:00
Dmitry Baranovskiy
42487bf47d Fixed isEqual if second object has isEqual implemented and added isObject method 2011-06-07 09:48:34 +10:00
shinuza
40af1652eb Modified any/some test case to demonstrate issue #177
Fixed any/some formatting to be consistent with the rest of underscore.js
2011-05-20 09:13:58 +02:00
Jeremy Ashkenas
057da5bc82 Issue #202 ... fallback method for sparse arrays. 2011-05-11 10:27:52 -04:00
shinuza
899000c217 Hashmap keys are not necessarily ordered. groupBy test may fail if the
expected order is not correct.
Fixing this by checking if the keys are present in the hash so
the order is not deterministic.
2011-05-07 12:03:02 +02:00
Andrei
f8a4b78a86 Adding groupBy. 2011-05-05 14:00:40 -04:00
Jeremy Ashkenas
13d4e626a8 removing obsolete _.after test. 2011-04-15 18:02:51 -04:00
Jeremy Ashkenas
ea44179d81 Issue #123. _.extend shouldn't copy keys for undefined values. 2011-04-15 17:46:16 -04:00
Jeremy Ashkenas
bf214d2c8d stricter ECMA5 compliance. _.every now requires an iterator to be passed. #160 2011-04-15 17:17:54 -04:00
Jeremy Ashkenas
3df562f07e tweaking invoke implementation 2011-04-15 17:00:37 -04:00
Jeremy Ashkenas
8f67aa3f18 _.barrier -> _.after, switch the order of arguments ... fix test formatting. 2011-04-15 16:17:58 -04:00
Sam Gentle
217a6a6a63 _.barrier + tests 2011-04-14 07:19:05 +10:00
Samuel Clay
1fc7d4b049 Revert "Adding _.count to count truthy values in an iterator. _.count([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }) = 3"
This reverts commit c8e3c04076.

Conflicts:

	underscore.js
2011-04-06 09:03:40 -04:00
Samuel Clay
c8e3c04076 Adding _.count to count truthy values in an iterator. _.count([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }) = 3 2011-04-05 18:09:47 -04:00
Aseem Kishore
de50fc4607 Add test case for invoke w/ function reference. 2011-03-25 12:06:10 -07:00
Jeremy Ashkenas
39119065dc Adding _.once ... Issue #121 2011-03-20 19:32:20 -04:00
Jeremy Ashkenas
52916aad87 Merge branch 'master' of https://github.com/TrevorBurnham/underscore 2011-03-20 19:26:52 -04:00
Jeremy Ashkenas
866cd35236 merging in michaelficarra's issue95 2011-03-20 18:50:56 -04:00
Jeremy Ashkenas
25457982a8 new version of qunit ... fixing up tests. 2011-03-20 18:21:49 -04:00
Kit Goncharov
48abcd84c5 Issue #149: _.keys should throw a TypeError for non-objects. 2011-03-20 10:08:32 -06:00
Kit Goncharov
4869b4c6ca Issue #150: _.bind should allow binding functions to falsy values. 2011-03-20 09:36:44 -06:00
Michael Ficarra
1f2c9c5fc1 added regression test for issue #95 2011-03-04 10:15:48 -05:00
Adam Craven
9c9731e08e Added support for ECMAScript 5 native bind method if available. Additional unit test to cover multiple argument binds. 2011-02-20 21:03:52 +01:00
Trevor Burnham
b39205b359 Adding _.once, for running a function once 2011-02-08 15:28:45 -05:00
Jeremy Ashkenas
226b7d9344 Adding _.defaults, Issue #106 2011-02-01 21:19:58 -05:00
Samuel Clay
7aaf3616df Issue #107: Fixing issue with _.first([1,2,3], 0) returning first element instead of empty array. 2011-01-27 11:38:06 -05:00
lifesinger
840f19c102 bug fix for _.memoize when key is derived from prototype 2011-01-17 14:57:02 +08:00
Jeremy Ashkenas
d2d6cfe667 Rework of #68, to use a flag to indexOf, instead of a separate function. 2010-12-17 10:57:12 -05:00
Jeremy Ashkenas
8c2570b0ba Issue #68. Adding _.sortedIndexOf 2010-12-17 10:35:53 -05:00
Jeremy Ashkenas
3a113d2d88 Issue #79. Correctly setting 'this' in '_.wrap' 2010-12-13 16:25:55 -05:00
Ryan W Tenney
cdcf18b79c Improve compliance with Array methods in ES5 when passed a null value. (ES5 Array methods treat null like []) 2010-12-06 23:36:54 -05:00
Jeremy Ashkenas
70d760f4f5 merging in jasondavies isEqual patch for wrapped objects. 2010-12-03 10:03:30 -05:00
Jason Davies
2120b27b22 Fix _.isEquals() for wrapped objects
This caught me out when writing some unit tests that use _.isEquals().
They were all passing even though I knew they shouldn't be, and I
realised I was checking equality with a wrapped object that I'd
forgotten to unwrap.
2010-12-03 13:01:58 +00:00
Jeremy Ashkenas
2d06e1d526 Issue #70 -- implementing each, find, all, any, etc. without the use of a try/catch/throw. Minor speedup + avoids destroying the stack trace. 2010-12-01 11:08:34 -05:00
Jeremy Ashkenas
6b8bb0cacd Better Underscore isType checking, in the presence of Internet Explorer host objects, which are a bit touchy. 2010-12-01 10:25:55 -05:00
Jeremy Ashkenas
00237103fc removing an errant a. 2010-12-01 09:49:45 -05:00
Jeremy Ashkenas
9e3e067f50 Initial draft of _.throttle and _.debounce 2010-11-30 11:41:48 -05:00
Jason Davies
47eb154ccf Preserve backslashes in _.template()
For example, templates containing things like the literal string
`\ribbit` weren't being escaped properly when being compiled. The `\r`
was being interpreted as a carriage return character.

I've added a test for this too, and all the existing tests pass.
2010-11-09 22:59:03 +00:00
Jeremy Ashkenas
a08c3dbd6b Merge branch 'fix_reduceRight_initial_value' of http://github.com/mcmire/underscore 2010-11-01 08:42:19 -04:00
Elliot Winkler
f729769d85 Fix reduceRight() so that if you don't pass in an initial value, the last item in the collection is used 2010-10-31 19:03:52 -06:00
Elliot Winkler
c21e7b24c6 Fix reduce() so that if you don't pass in an initial value, the first item in the collection is used 2010-10-31 18:51:30 -06:00
Jeremy Ashkenas
8fe19f2023 Underscore 1.1.2 2010-10-15 17:21:41 -04:00