Skip to content

Conversation

@laomaiweng
Copy link

The arguments-matching regexp in utils/arg.js fails for anonymous functions (function(args) { ... }) because it expects a space after function.

Add a non-capturing group to make the space and function name optional.

This was spotted while trying to build nodegit from source.

The arguments-matching regexp in _utils/arg.js_ fails for anonymous functions (`function (args) { ... }`) because it expects a space after `function`. Add a non-capturing group to make the space and function name optional.
@tbranyen
Copy link
Member

tbranyen commented Jun 5, 2018

Hi @laomaiweng thanks for the PR, I ended up going a different route with the regex to also support arrow functions. I tried your approach with my new unit test and was not able to get it to pass. I'm going to close this pr in favor of #31.

Thanks again!

@tbranyen tbranyen closed this Jun 5, 2018
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

Successfully merging this pull request may close these issues.

2 participants