Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix regexp for anonymous functions#30

Closed
laomaiweng wants to merge 1 commit intonodegit:masternodegit/promisify-node:masterfrom
laomaiweng:patch-1laomaiweng/promisify-node:patch-1Copy head branch name to clipboard
Closed

Fix regexp for anonymous functions#30
laomaiweng wants to merge 1 commit intonodegit:masternodegit/promisify-node:masterfrom
laomaiweng:patch-1laomaiweng/promisify-node:patch-1Copy head branch name to clipboard

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.