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

Rest params for function declarations #205

Closed
wants to merge 11 commits into from

Conversation

robertmaloney
Copy link

Part of #151

TODO

  • tests for arrow functions
  • rebase

write!(f, "function({}){}", rf.args.join(", "), rf.expr)
write!(f, "function(")?;
let last_index = rf.args.len() - 1;
for (index, arg) in rf.args.iter().enumerate() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This loop can be rewritten using .iter().join().

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An attempt was made, but I'm having trouble converting rf.args into a format that supports join.

@jasonwilliams
Copy link
Member

@robertmaloney this is great, do you know why the tests are failing?

@jasonwilliams
Copy link
Member

jasonwilliams commented Nov 19, 2019

Fixed test,
Looks like this doesn't handle spread syntax as an argument to a function, looking into that.
Looks like we need a method to extract the properties of an object and return a Vec<Gc<ValueData>>

@jasonwilliams
Copy link
Member

@robertmaloney
Copy link
Author

Happy to see it taken care of, thanks for closing!

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.

3 participants