-
-
Notifications
You must be signed in to change notification settings - Fork 407
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
Allow BindingPattern
in function parameters
#1601
Comments
Hey, |
@am-a-man Hey :) However, seeing as you're a first contributor, we cannot assign you multiple tasks at the same time. This is partly because we wouldn't want to saturate a newcomer with too many tasks and partly because we would like to give a chance to some other people to get involved themselves with the project and possibly become regular contributors. Nonetheless, we would absolutely love if you contributed to Boa, so please tell us which one of the issues you would like to work on, and we will assign it to you :D |
this issue and #1600 are quite similar, but assign me this issue and I'll check afterwards if it's still unassigned I'll request again |
@am-a-man Assigned. Let us know if you need mentoring or if you have any questions ☺ |
Yeah, it would be great if you could help me to get started. |
The best place to start for this would be in the file https://github.com/boa-dev/boa/blob/master/boa/src/syntax/parser/function/mod.rs. There we have the struct When you compare the spec to the parser implementation, you will notice that we currently only implement one possible parsing path; you can follow in the spec: We already have a working parser for The first step would be to check if the next token is the start of a Next you probably have to adjust the output type of the parser. You can see the the parser returns a I hope that helps :) |
@raskad hey, I allowed
it works as it should in nightly as well as when I comment
https://github.com/boa-dev/boa/blob/master/boa/src/builtins/typed_array/mod.rs Can you suggest what could be wrong? |
@am-a-man Update your rustc. The feature was stabilized on 1.54 |
ECMASCript feature
Currently we only allow
BindingIdentifier
s in theFormalParameter
s of functions.BindingPattern
s should be also allowed.ECMAScript specification
Example code
This code should work and give the expected result:
Good starting points would be the
FormalParameter
parsing in https://github.com/boa-dev/boa/blob/master/boa/src/syntax/parser/function/mod.rs and theBindingPattern
parsing in https://github.com/boa-dev/boa/blob/master/boa/src/syntax/parser/statement/mod.rsThe text was updated successfully, but these errors were encountered: