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

ES6 Arrow functions? #190

Closed
internalfx opened this issue Jul 16, 2015 · 4 comments

Comments

@internalfx
Copy link

commented Jul 16, 2015

var test = {
  stuff: () => { // gives 'Unexpected token ) at line 4 col 12
    console.log('it works')
  },
  moreStuff: () => {
    console.log('it works still')
  }
}

test.stuff()

Babel seems to successfully compile this to

var test = {
  stuff: function stuff() {
    console.log('it works');
  },
  moreStuff: function moreStuff() {
    console.log('it works still');
  }
};

test.stuff();
@internalfx

This comment has been minimized.

Copy link
Author

commented Jul 16, 2015

I should add that standard only complains about the first arrow function stuff, the moreStuff function has no error

@dcousens

This comment has been minimized.

Copy link
Member

commented Jul 17, 2015

Looks like an eslint bug to me.
@feross confirm?

@internalfx

This comment has been minimized.

Copy link
Author

commented Jul 17, 2015

Sorry guys, I apparently had 2 conflicting linters. closing...

@dcousens

This comment has been minimized.

Copy link
Member

commented Jul 17, 2015

Thanks @internalfx, I hadn't had time to check this yet.

@lock lock bot locked as resolved and limited conversation to collaborators May 11, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.