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

[Merged by Bors] - Move increment and decrement operations to Update expression #2565

Closed
wants to merge 2 commits into from

Conversation

raskad
Copy link
Member

@raskad raskad commented Jan 26, 2023

This Pull Request changes the following:

  • Move postfix/prefix increment and decrement operations from the Unary expression to a new Update expression.
  • Add a special type for the Update expression target as it is very limited in comparision to an Unary target.
  • This makes bytecode compilation more typesafe for these operations and removes syntax errors from the bytecompiler without introducing panics (see Move syntax errors from the compiler to the parser #1907).

@raskad raskad added enhancement New feature or request parser Issues surrounding the parser labels Jan 26, 2023
@raskad raskad added this to the v0.17.0 milestone Jan 26, 2023
@github-actions
Copy link

github-actions bot commented Jan 26, 2023

Test262 conformance changes

Test result main count PR count difference
Total 94,205 94,205 0
Passed 70,720 70,720 0
Ignored 18,622 18,622 0
Failed 4,863 4,863 0
Panics 0 0 0
Conformance 75.07% 75.07% 0.00%

@codecov
Copy link

codecov bot commented Jan 26, 2023

Codecov Report

Merging #2565 (35269ff) into main (aa8e0c5) will increase coverage by 0.12%.
The diff coverage is 75.51%.

@@            Coverage Diff             @@
##             main    #2565      +/-   ##
==========================================
+ Coverage   50.01%   50.14%   +0.12%     
==========================================
  Files         380      381       +1     
  Lines       37786    37776      -10     
==========================================
+ Hits        18900    18941      +41     
+ Misses      18886    18835      -51     
Impacted Files Coverage Δ
boa_ast/src/expression/operator/unary/mod.rs 52.63% <ø> (ø)
boa_ast/src/expression/operator/unary/op.rs 0.00% <ø> (ø)
boa_ast/src/expression/operator/update/op.rs 0.00% <0.00%> (ø)
boa_ast/src/visitor.rs 12.64% <0.00%> (-0.73%) ⬇️
boa_engine/src/bytecompiler/expression/unary.rs 100.00% <ø> (+6.89%) ⬆️
boa_ast/src/expression/mod.rs 50.86% <33.33%> (-0.47%) ⬇️
boa_ast/src/expression/operator/update/mod.rs 46.15% <46.15%> (ø)
boa_engine/src/bytecompiler/expression/mod.rs 52.43% <100.00%> (+0.25%) ⬆️
boa_engine/src/bytecompiler/expression/update.rs 100.00% <100.00%> (ø)
boa_engine/src/bytecompiler/mod.rs 57.87% <100.00%> (+0.17%) ⬆️
... and 13 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@raskad raskad force-pushed the update-expression branch from 607602d to 8fc2b9e Compare January 28, 2023 16:24
Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

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

Looks really nice!

Comment on lines +68 to +72
fn as_simple(
expr: &Expression,
position: Position,
strict: bool,
) -> ParseResult<Option<UpdateTarget>> {
Copy link
Member

Choose a reason for hiding this comment

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

Really liked this change!

@raskad
Copy link
Member Author

raskad commented Feb 1, 2023

bors r+

bors bot pushed a commit that referenced this pull request Feb 1, 2023
This Pull Request changes the following:

- Move postfix/prefix increment and decrement operations from the `Unary` expression to a new `Update` expression.
- Add a special type for the `Update` expression target as it is very limited in comparision to an `Unary` target.
- This makes bytecode compilation more typesafe for these operations and removes syntax errors from the bytecompiler without introducing panics (see #1907).
@bors
Copy link

bors bot commented Feb 1, 2023

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Move increment and decrement operations to Update expression [Merged by Bors] - Move increment and decrement operations to Update expression Feb 1, 2023
@bors bors bot closed this Feb 1, 2023
@bors bors bot deleted the update-expression branch February 1, 2023 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request parser Issues surrounding the parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants