-
Notifications
You must be signed in to change notification settings - Fork 4
ES6 support #2
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
Comments
There's also |
IMHO this qualifies for a different regex. like |
technically this shouldn't even be called "function-regex" since it's not. It should be more specific, like: https://github.com/jonschlinkert/parse-code-context/blob/master/index.js#L14-L33 |
I agree that this is probably out of scope for this package. But, come to think of it, a regex will never be able to handle destructured parameters in the general case, since regular languages don't support balanced delimiters. |
FYI: that regex shares several issues with this regex and adds at least one new issue e.g. it doesn't handle: function foo () {} // > 1 space or: function // newline
foo () {} |
Yea, I think it should go to something like |
Closing this, since — as mentioned — a regex can't handle all ES6 function syntax (e.g. destructuring). |
Various ES6 features are unsupported e.g.:
test
output
The text was updated successfully, but these errors were encountered: