Skip to content

Function call brackets closes incorrectly when have ES6 arrow function as argument #378

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

Closed
unclechu opened this issue Apr 15, 2016 · 10 comments

Comments

@unclechu
Copy link
Contributor

I hope this screenshots will explain a lot:
bug with ES6 arrow function
works correctly with usual function
Here the text example:

  • ES6 arrow bug: it**('_.blind()**', () => {});
  • Usual function: it**('_.blind()', function () {})**;
@amadeus
Copy link
Collaborator

amadeus commented Apr 15, 2016

Yup, known issue. We'll get a fix out shortly!

@unclechu
Copy link
Contributor Author

May be it's same issue:
Issue demonstration screenshot
First => wasn't highlighted.

@amadeus
Copy link
Collaborator

amadeus commented Apr 20, 2016

Things should be sort of fixed for now in develop.

@unclechu I am working on another PR to bring some of the old functionality back, do you mind posting your screenshot snippets as code examples? So I can work them into a test file for the next update?

The more crazier examples you can provide that you actually end up using, would be super helpful!

@jackfranklin
Copy link

@amadeus just wanted to say thanks for your work on this, and generally for your work on this repo. As a user it's awesome to see issues being fixed so quickly, and I really appreciate it :)

@unclechu
Copy link
Contributor Author

unclechu commented Apr 21, 2016

@amadeus

const f = func('_.foo()', () => {});
const async = require('async');
const fs = require('fs');
async.waterfall([
  (cb) => cb(null, 'file.txt'),
  (path, cb) => fs.exists(path, (exists) => cb(null, exists)),
], (err, exists) => { if (err) console.error(err); else console.log('exists:', exists) });

@unclechu
Copy link
Contributor Author

@amadeus

const found = _.find(headers, (it) => /^Content-Length: \d\+$/i.test(it));

@amadeus
Copy link
Collaborator

amadeus commented Apr 22, 2016

@unclechu these are great, thanks!

@amadeus
Copy link
Collaborator

amadeus commented Apr 22, 2016

This issue should be fixed in develop

@amadeus amadeus closed this as completed Apr 22, 2016
@unclechu
Copy link
Contributor Author

Also arrow function single argument without brackets example:

const found = _.find(headers, it => /^Content-Length: \d\+$/i.test(it));
const async = require('async');
const fs = require('fs');
async.waterfall([
  cb => cb(null, 'file.txt'),
  (path, cb) => fs.exists(path, (exists) => cb(null, exists)),
], (err, exists) => { if (err) console.error(err); else console.log('exists:', exists) });

@unclechu
Copy link
Contributor Author

@amadeus now it works nice, thanks a lot!

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