7685 Commits

Author SHA1 Message Date
Jeremy Ashkenas
868c5c8d85 adding melmacian's Underscore.strings to the Links section of the docs 2010-07-05 15:35:11 -04:00
Jeremy Ashkenas
1a67c8d3a7 adding Andri's link to the changelog 2010-06-22 12:49:59 -04:00
Jeremy Ashkenas
29e2c832bc Underscore 1.0.4, with _.memoize 2010-06-22 09:21:03 -04:00
Jeremy Ashkenas
d62906672b adding a main stanza to package.json for npm installation. 2010-06-14 16:13:22 -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
AJ ONeal
f0427da9cf Fixed documentation typo. Renamed _.isFuction to _.isString. 2010-04-04 13:27:02 -07: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
78245c206f adding a version number to package.json -- the format has changed 2010-03-14 10:11:42 -07: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
c519889a45 Changelog bump. 2010-02-24 15:16:20 -05: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
8d632ada0b added documentation for _.mixin 2010-02-24 14:04:33 -05:00
Jeremy Ashkenas
513f878482 it's now 2010, and adding a list of contributors (everyone who's ever gotten a patch in) 2010-02-24 13:58:16 -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
c23b2ce717 added documentation for _.times 2010-02-24 13:09:08 -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
Jeremy Ashkenas
39024c35a6 waypoint commit on the big merge 2010-02-24 12:03:08 -05:00
Jeremy Ashkenas
2ec05e758b merging ratbeard/closure 2010-02-24 11:45:05 -05:00
Jeremy Ashkenas
a2aab7c699 merging ratbeard's numerous improvements 2010-02-24 11:38:27 -05:00
Jeremy Ashkenas
875633141a merging rlfletchers branch with a safer _.template when the template delimiter includes RegExp characters. 2010-02-24 11:03:47 -05:00
Rick Fletcher
3482ec1259 Escape template delimiters before using them in a RegExp 2010-02-23 23:47:28 -08:00
Rick Fletcher
38a82591b1 Added failing test for quotes in statements with regex-significant characters in tokens 2010-02-23 23:44:25 -08:00
Rick Fletcher
625adb81a3 Added tests for templates with regex-significant characters in their delimiters 2010-02-23 23:41:51 -08:00
Mike Frawley
b8fd129130 only initWrapper() once. make wrapper constructor accessable as _._wrapper.
Previously, there was no way to get at the OO wrapper object.
So if a user added a custom method on to _, or defined a custom
alias, it would not be reflected in the wrapper.  Now it is at
least possible, though there is no API to do it.  I alluded to
making one in my commit that added _.alias() (which I recently reverted,
as it added weight to the stripped version), but honestly I think
the wrapping behavior should go in to a seperate library, not because
it is bad, but because it is an awesome pattern that I want to use
on objects other than underscore.
2010-02-23 18:20:42 -06:00
Mike Frawley
c9b41a4996 modify rakefile build_advanced to strip off my call to _.initWrapper() 2010-02-23 18:14:54 -06:00
Mike Frawley
f591f68546 make _.initWrapper() that builds the wrapper prototye
The intention is that underscore Consumers MUST call _.initWrapper()
in their code to allow the OO style usage, or a runtime error is thrown.
This would break backwards compatability, so for the moment I call
initWrapper myself at the end of underscore.

However, if I comment out my call to initWrapper and don't call it
in user code, then the compiler can strip an empty underscore with
no user code from 2137 -> 100 bytes.  Making the user explicitly say
they want OO wrapping is the only way to achieve this, otherwise the
compiler will always keep the OO wrapper code around.
2010-02-23 18:04:47 -06:00
Mike Frawley
1cf73c5474 Re-arrange baseline setup section.
Put all variable declartions in a row, so they can all be
chained together with commas by compiler.

Move wrapper creation code down in OO section.  Not necissary
for `var wrapper` to be defined when _ constructor is defined.
Preparing way to make OO wrapping optional..
2010-02-23 17:39:22 -06:00
Mike Frawley
59d383c151 Revert "Create #alias method, callable on any object, _ by default."
This reverts commit c43de549ba.

Conflicts:

	test/objects.js
2010-02-23 17:26:32 -06:00
Mike Frawley
164e19c121 use var native_reduceRight etc. variables instead of Native = { reduceRight: ... }
This way we only get the native versions of functions we use.
Will make testing non-native versions as we can't just swap do `_.Native = {}`,
but this wouldn't have worked for `isArray` and `keys` anyways, as these are
looked up on initialization, so I think the solution is to have an init()
method on underscore where we will re-initialize functions and try and use
native versions then
2010-02-23 17:13:18 -06:00
Mike Frawley
b5449ca89a Add rake task to build with closure advanced optimizations.
You would use this to compile your code _with_ underscore, to
remove all those dead underscore functions you don't use.

Slight tweak to code to `root._` code to get working, and must
remove anonymous wrapper function for current closure compiler to
remove dead code.
2010-02-23 17:01:18 -06:00
Mike Frawley
31f0f8c54c make a local variable that points to Array.prototype since the former is not min'd down.
Won't effect gzip size, but reduces min size.  Saves about:

15 bytes per instance * 13 instances ≅ 200 bytes
2010-02-22 16:02:36 -06:00
Mike Frawley
bb250e7205 Much better strategy for calling native Array methods.
Compare an object's function with === to the native
version before calling it.  That is, don't just assume that
because an object has a 'filter' property thats a function,
that we should call that in _.filter().

Expose the native methods found as _.native

On the way towards being able to turn off native implementations,
though there are tradeoffs...
2010-02-22 15:50:01 -06:00
Mike Frawley
b774bf7ca9 delegate to ECMA5 native Array.isArray if available 2010-02-22 14:37:54 -06:00
Mike Frawley
5a5e14d7a4 add #times utility method.
_(3).times(alert)

added tests and internal docs
2010-02-17 10:21:59 -06:00