-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
methodize utility #3
Comments
In this regard, it might be at least useful to add the ES5 Array methods (forEach, etc), if they don't already exist. That's probably where I'd draw the line. _.es5compat() perhaps? |
Hmm. That is indeed the point of having this project. Is there a reason you would use Underscore over Prototype.js in your situation? If you can make that case, and it can be accomplished in a small amount of code, I'd be glad to take a patch for it. |
For the record: smith sent you a message. Subject: No reason other than underscore is lighter weight than Prototype.js and their isn't a widely used library to bring platforms up to minimal es5 standards that can be implemented in es3. I'll let you know if I make a patch, but it probably won't happen any time soon. |
I think we would need to take a position one way or another -- either no namespace pollution, or make all of the underscore methods available. There should be no confusion as to which methods exist and which do not -- a big part of structuring Underscore in the way it is in the first place. Underscore could be a good starting point for an "ES5Compat.js", which is something that's very much needed in its own right, just not quite what Underscore is trying to be. |
Agreed. Was just throwing the idea out there. BTW, I already have a branch of Prototype.js that is a subset and doesn't contain any DOM stuff, in case anyone is interested: http://github.com/smith/prototype-asp |
Great -- that's why it's good to talk about it, and to have this stuff online for reference. I'll close the issue. |
I think I've changed my mind. ES5Compat.js should probably be something different. And should cover more stuff than the array methods, probably, so even using underscore.js to do it is probably overkill. Besides, who needs ES5Compat.js when there's underscore.js???!!! |
I'd have to to say ES5Compat.js sounds like a nice plugin. :) |
You could just grab this: http://github.com/280north/narwhal/blob/master/engines/default/lib/global-es5.js |
This is a feature request: How about a _.methodize() (or some other name) utililty that adds the methods to the native objects?
I know the point of the library is to not extend the native objects, but since all of the methods are defined it would be nice to have a way to make them included.
Please close if you disagree.
The text was updated successfully, but these errors were encountered: