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

Add support for other function parameters #12

Open
nandanmen opened this issue Dec 16, 2020 · 0 comments
Open

Add support for other function parameters #12

nandanmen opened this issue Dec 16, 2020 · 0 comments
Labels
app feature core feature unrelated to ux transformer tickets related to the custom babel transform

Comments

@nandanmen
Copy link
Owner

nandanmen commented Dec 16, 2020

The transformer currently only supports Identifier-based function parameters, e.g.

function hello(a, b)

It doesn't support parameters made using things like array destructuring, object destructuring, rest operators, assignment patterns, etc. All of the following examples will throw errors:

  1. Array destructuring
function ([a, b])
  1. Object destructuring
function ({ a, b })
  1. Rest operators
function (a, b, ...others)
  1. Assignment/default parameters
function (a, b = 0)
function (a, b, c = a * b)

It would be nice to add support for these, however it's important to note that this will impact both the transformer and the application since:

  • for the transformer, we have to be able to parse and correctly record these parameters, and
  • for the app, we would have to change the argument form to correctly send the appropriate arguments to the function.
@nandanmen nandanmen added app feature core feature unrelated to ux transformer tickets related to the custom babel transform labels Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app feature core feature unrelated to ux transformer tickets related to the custom babel transform
Projects
None yet
Development

No branches or pull requests

1 participant