-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Fix arguments leakage in fn.bind polyfill #853
Conversation
Pretty sure this is going to pass along the |
Whoops I didn't notice the top one sliced an arg off, I'll get it patched up tonight! Edit: yeah I'll also cook up some tests. |
@englercj Maybe a better question is, do we need this? I'm not sure that any browser that has a decently running canvas wouldn't have In any case I'm actually not sure how to test this, since our test env will not use our polyfill but rather the native version. |
To test it, export it as another function Do we need it? That is a great question, I would be surprised if we did... |
@englercj this is the fixed version. Here's the compatibility tables for https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind#Browser_compatibility Seems to be missing from Safari 5 / 5.1 |
That stinks! Canvas was added to safari in 2.0, so we do need this polyfill I guess... I will merge this in if you write a few simple tests for it :D THANKS! |
Preliminary tests / benchmarks against an existing |
Very cool! Seems like there is a perf increase for sure using this method instead of what we have now! (btw what I meant by tests were just a couple unit tests in the PR itself 😄) |
Yeah I know, I'll write them tomorrow haha |
Fix arguments leakage in fn.bind polyfill
@englercj did you do any testing? Sorry I've been away and busy. :s |
Nah, just going through and cleaning some PRs decided to merge this for now. Feel free to add tests though still :D |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bluebird has done a bunch of research into Javascript optimization blockers, which includes strict arguments usage:
https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments