Skip to content
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

"bindAll must be passed function names " #992

Closed
markvr opened this issue Mar 1, 2013 · 3 comments
Closed

"bindAll must be passed function names " #992

markvr opened this issue Mar 1, 2013 · 3 comments
Labels

Comments

@markvr
Copy link

markvr commented Mar 1, 2013

Previously to v1.4.4, using "_.bindAll(this);" would work as expected, and as per documentation: " If no methodNames are provided, all of the object's function properties will be bound to it."

In v1.4.4 "_.bindAll(this);" throws an error - "bindAll must be passed function names "

In the diff for 1.4.3 and 1.4.4 (https://gist.github.com/ahomu/4700664) at lines 107 this was changed:

  • if (funcs.length == 0) funcs = _.functions(obj);
  • if (funcs.length === 0) throw new Error("bindAll must be passed function names");

This isn't in the changelog, and the documentation is out-of-date

Out of interest, why was this changed? Attempting to update 1.4.4 has broken a lot of my code!

@braddunbar
Copy link
Collaborator

Mornin' @markvr! _.bindAll has been changed recently, but it is not included in version 1.4.4. The change is only in the master branch. There is some discussion about the change in bf657be. Check it out and let us know what you think.

@spadgos
Copy link
Contributor

spadgos commented Mar 1, 2013

It's probably misleading to name it "bindAll" then, no?

@chakrit
Copy link

chakrit commented Jul 12, 2013

Will you please at least respect some backward compatibility?

Quoting http://semver.org/

Given a version number MAJOR.MINOR.PATCH, increment the:

  1. MAJOR version when you make incompatible API changes,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants