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

Support arrow functions without a block statement #421

Merged
merged 1 commit into from Jun 1, 2018
Merged

Support arrow functions without a block statement #421

merged 1 commit into from Jun 1, 2018

Conversation

aengl
Copy link
Contributor

@aengl aengl commented May 17, 2018

#393 supports arrow functions, but will fail when using arrow functions without block statements, like the one mentioned by @julien-c in #389:

function: !!js/function >
  () => 'Wow! JS-YAML Rocks!';

Like @kivlor pointed out already, there's no constructor for ArrowFunction, so this is a bit of a workaround. Personally, I'd rather see this resolved with a safe-eval.

@puzrin
Copy link
Member

puzrin commented May 17, 2018

LGTM.

Kick me in a couple of days, i'll merge & publish if no more objections.

@aengl
Copy link
Contributor Author

aengl commented May 28, 2018

@puzrin Ping 😃

@puzrin puzrin merged commit 290705b into nodeca:master Jun 1, 2018
@puzrin
Copy link
Member

puzrin commented Jun 1, 2018

Sorry for silence. Published new version with your fixes. Thanks for efforts and patience!

@julien-c
Copy link

This is awesome, thank you

@aengl aengl deleted the aen/arrow branch July 18, 2018 12:38
@dvv
Copy link

dvv commented Nov 29, 2019

Converting ({ foo, bar}) => "baz" eats argument. Please consider to support the case. TIA

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.

None yet

4 participants