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

arrow function are not "bindables" #572

Closed
dcharbonnier opened this issue Apr 2, 2017 · 2 comments
Closed

arrow function are not "bindables" #572

dcharbonnier opened this issue Apr 2, 2017 · 2 comments

Comments

@dcharbonnier
Copy link
Contributor

https://github.com/minio/minio-js/blob/master/src/main/minio.js#L282
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions

> obj = {test:"from the object"}
{ test: 'from the object' }
> let arrowFunction = () => console.log(this.test);
> let regularFunction = function() {console.log(this.test)};
> let bindArrowFunction = arrowFunction.bind(obj);
> let bindRegularFunction = regularFunction.bind(obj);
> arrowFunction()
undefined
> regularFunction()
undefined
> bindArrowFunction()
undefined
> bindRegularFunction()
from the object
@krishnasrinivas
Copy link
Contributor

thanks @dcharbonnier }.bind(this) must have been from previous code when it was function(){ } style, we'll fix it.

krishnasrinivas added a commit to krishnasrinivas/minio-js that referenced this issue Apr 3, 2017
Add command in package.json for browserify.

Fixes minio#572
@deekoder deekoder added this to the Current milestone Apr 3, 2017
@deekoder
Copy link
Contributor

deekoder commented Apr 3, 2017

Pending PR

harshavardhana pushed a commit that referenced this issue Apr 3, 2017
Add command in package.json for browserify.

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

No branches or pull requests

4 participants