Commit Graph

161 Commits

Author SHA1 Message Date
Ryan W Tenney
18e85b813f slice(0) is interchangable with slice() (in method clone) 2010-10-05 22:47:55 -04:00
Ryan W Tenney
1c6e01173a "Cleaned up"? _.range (or maybe not) 2010-10-05 22:36:15 -04:00
Ryan W Tenney
2dc203332b Changed reduceRight to avoid unnecessarily cloning an array.
`toArray` returns the first argument unmodified if it passes `isArray`.
So if `obj` passes `isArray`, call `slice` on it directly, otherwise use `toArray`.
2010-10-05 21:22:37 -04:00
Ryan W Tenney
2aec074aca Define aliases inline. 2010-10-05 21:10:14 -04:00
Ryan W Tenney
644c5aa2ce Expose wrapper.prototype as _.prototype 2010-10-05 20:32:57 -04:00
Ryan W Tenney
4484002f7e escapeRegExp is no longer used. 2010-10-05 20:30:57 -04:00
Ryan W Tenney
cd7c9ee964 Simplify _.clone a little bit. 2010-10-05 20:28:23 -04:00
Jeremy Ashkenas
faa672ecd9 Underscore 1.1.1 2010-10-05 17:52:36 -04:00
Jeremy Ashkenas
a80550ccd2 Tweaks to the Annotated Underscore. 2010-10-05 17:41:11 -04:00
Jeremy Ashkenas
348147d8fb better default multiline-aware templates 2010-10-05 17:10:44 -04:00
Jeremy Ashkenas
5984be70c1 adding m flag to default templateSettings regexes. 2010-10-05 17:05:03 -04:00
Jeremy Ashkenas
7b25bbef4f Merge branch 'improuvements' of http://github.com/ryantenney/underscore 2010-10-05 16:57:56 -04:00
Jeremy Ashkenas
3f49d1df30 Tweaking Underscore for docco-mentation. 2010-10-05 16:44:56 -04:00
Ryan W Tenney
79600d6e9c Use slice.call internally when working with arguments instead of _.toArray or _.rest 2010-10-03 16:34:38 -04:00
Ryan W Tenney
3505f79566 Replaced .split("'").join("\\'") with .replace(/'/g, "\\'"). http://jsperf.com/split-join-vs-replace 2010-09-27 21:55:49 -04:00
Jeremy Ashkenas
fbd682d9ec Fixing Issue #35. newlines in evaluated code. 2010-09-27 17:35:43 -04:00
Samuel Clay
2068f0819d Fixing _.template() bug where using 'p' as a variable name would override the variable by the same name in _.template(), causing an error. See test case utilities.namespaceCollisionTemplate() for example of broken case. 2010-09-23 12:35:25 -04:00
Ryan W Tenney
7df67bcc4d Revert change of new Array(len) to []. 2010-09-01 16:18:22 -04:00
Ryan W Tenney
19acc63374 Improuvements: removed calls to String(…) (speed), construction of arrays like new Array(len) (standards), replaced arr.push(val) with arr[arr.length] = val (speed). 2010-08-31 17:02:32 -04:00
Ryan W Tenney
116ff91bec Guarantee boolean return value from _.isArguments 2010-08-31 14:53:12 -04:00
Jeremy Ashkenas
7a4ddca64d Revert "slight speedup to _.template"
This reverts commit 7973d7263c.
2010-08-26 02:01:24 -04:00
Jeremy Ashkenas
7973d7263c slight speedup to _.template 2010-08-26 01:02:09 -04:00
Jeremy Ashkenas
fc90d57e36 Underscore.js 1.1.0 2010-08-18 09:26:36 -04:00
Jeremy Ashkenas
b2b5a5390b merging a variant of svieira's fix for preserving whitespace within templates. 2010-07-20 13:37:27 -04:00
Jeremy Ashkenas
ef396a9e13 Aliasing _.contains to _.include 2010-07-15 10:18:11 -04:00
Jeremy Ashkenas
9827f87611 (breaking change) moving _.reduce's method signature to that of ECMA5. _.reduce(obj, iterator, memo). Updated tests and docs. 2010-07-15 09:50:55 -04:00
Nick Stenning
e81a2ec516 Allow _.template functions to be called with no arguments.
This change simply allows templates to be called with no arguments, for a behaviour equivalent to being called with an empty object, {}.
2010-07-14 11:09:05 +01:00
Jeremy Ashkenas
29e2c832bc Underscore 1.0.4, with _.memoize 2010-06-22 09:21:03 -04:00
Jeremy Ashkenas
bce016fc72 Underscore 1.0.3 2010-06-14 15:59:24 -04:00
Ryan W Tenney
0e8ca3cb97 NaN is never equal to NaN. Fixed in underscore.js and underscore-min.js, updated tests in test/objects.js 2010-06-12 17:10:48 -04:00
Jeremy Ashkenas
79f65b440a Even though it's not really part of the API, making _.isEmpty work with Strings cross-browser. 2010-04-06 13:01:45 -04:00
Jeremy Ashkenas
c8858f4c8f Underscore 1.0.2, with a fixed _.isArguments for Opera 2010-03-23 11:06:11 -04:00
Jeremy Ashkenas
a6578068d2 Underscore 1.0.1 -- bugfix release for _.isEqual 2010-03-19 10:07:21 -04:00
Jeremy Ashkenas
1d787815af Underscore 1.0 2010-03-18 11:41:02 -04:00
Jeremy Ashkenas
d69c5ae83b merging ratbeard's patch for allowing multiple arguments to be passed to extend, with docs 2010-03-05 15:29:32 -05:00
Mike Frawley
4085b68be4 enhance #extend to allow taking multiple source objects.
This is done in jquery, extjs, and others as well.

added tests, no docs
2010-03-05 15:24:59 -05:00
Jeremy Ashkenas
8c6694c242 comment grammar 2010-03-05 15:24:53 -05:00
Jeremy Ashkenas
9903905175 merging mrjjwright's isBoolean, with tests, docs, and credit 2010-02-27 00:03:36 -05:00
John Wright
bd271e4794 added _.isBoolean function 2010-02-26 21:46:58 -07:00
Mike Frawley
d1ccc1e841 remove unused index variable in forEach 2010-02-26 08:47:36 -06:00
Jeremy Ashkenas
b8a633a5fd Underscore 0.6 is on the books. Think of it as a pre-release of 1.0 2010-02-24 15:10:40 -05:00
Jeremy Ashkenas
71b6e4f555 A whole slew of IE fixes and safety guards. 2010-02-24 15:01:51 -05:00
Jeremy Ashkenas
85d8f90bca move the OOP-setup bits down into that section for clarity. JavaScript allows this it's pre-declaration pass. 2010-02-24 13:49:57 -05:00
Jeremy Ashkenas
d855def438 adding an _.mixin utility function that allows you to add functions to Underscore (also used internally) 2010-02-24 13:44:46 -05:00
Jeremy Ashkenas
65d2c30312 don't use root as the default 'this' for a bound function, use an empty object instead. 2010-02-24 12:57:26 -05:00
Jeremy Ashkenas
d7acbca2ce reverted _.buildLookup, restoring _.without to it's previous implementation, adding a test for object identity 2010-02-24 12:53:35 -05:00
Jeremy Ashkenas
412d2e4486 avoiding isFunction in _.include 2010-02-24 12:47:40 -05:00
Jeremy Ashkenas
7824d63ce8 make the new faster isEmpty a little safer too 2010-02-24 12:43:57 -05:00
Jeremy Ashkenas
2c8fbe7875 remove the advanced_optimizations concessions and the advanced_optimizations rake task. Simple will do. 2010-02-24 12:16:45 -05:00
Jeremy Ashkenas
69bb3490b3 camelcase conventions 2010-02-24 12:10:07 -05:00