Implement Spread operator for Objects #214
Labels
E-Medium
Medium difficulty problem
enhancement
New feature or request
good first issue
Good for newcomers
Hacktoberfest
Hacktoberfest 2021 - https://hacktoberfest.digitalocean.com
help wanted
Extra attention is needed
Milestone
The rest operator has been implemented to arrays.
[a,b,...c]
But it is not implemented for objects.
test case
The array implementation exists here inside of exec.rs:
https://github.com/jasonwilliams/boa/blob/master/src/lib/exec.rs#L218-L223
Tests for this exist here too:
https://github.com/jasonwilliams/boa/blob/master/src/lib/exec.rs#L850-L862
https://github.com/jasonwilliams/boa/blob/master/src/lib/exec.rs#L202-L213 will need to do something similar.
There will need to be changes to the parser so spread can be parsed within an object. The above code will currently error in the parser as spread syntax isn't expecting within an object.
Parsing objects happens here:
https://github.com/jasonwilliams/boa/blob/master/src/lib/syntax/parser.rs#L522-L574
The text was updated successfully, but these errors were encountered: