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

The bind 'polyfill' is incomplete #2707

Closed
mako-taco opened this issue Mar 28, 2015 · 2 comments
Closed

The bind 'polyfill' is incomplete #2707

mako-taco opened this issue Mar 28, 2015 · 2 comments

Comments

@mako-taco
Copy link

Deleting Function.prototype.bind and replacing it with a non-working polyfill causes conflicts with other libraries for no good reason. The bind polyfill provided by mootools does not account for appended arguments that are bound to a function.

You can see an example on jsfiddle.

@DimitarChristoff
Copy link
Member

technically, it's not a polyfill as MooTools' bind pre-dates the standardisation of Fn.proto.bind

because of that, it differs. it's now a protected method but for compat's sake, it can also remain broken :)

please see #2473 - just stop using the compatibility build version of mootools.

https://jsfiddle.net/dimitar/z1f12s6p/1/ - your fiddle with the right version of mootools (https://ajax.googleapis.com/ajax/libs/mootools/1.5.1/mootools-nocompat-yui-compressed.js)

@arian
Copy link
Member

arian commented Mar 28, 2015

MooTools added Function.prototype.bind in like 2006, before it existed in ES5. Unfortunately that version is incompatible with ES5 .bind.

However we fixed that in version 1.3 a few years ago. The old behavior is only there to provide compatibility with old MooTools scripts.

In the default download on mootools.net, this compat layer is disabled by default.

So if you use the right (default) build, it will work fine, as it should.

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

No branches or pull requests

3 participants