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] - Fix unary operations on this #2507

Closed

Conversation

veera-sivarajan
Copy link
Contributor

This Pull Request fixes/closes #2416.

Previously, prefix increment and decrement operations on this caused a panic. This PR makes the parser issue a syntax error when the operand UnaryExpression is not simple (as mentioned in https://tc39.es/ecma262/#sec-update-expressions-static-semantics-early-errors).

@jedel1043 jedel1043 added bug Something isn't working parser Issues surrounding the parser labels Dec 26, 2022
@jedel1043 jedel1043 added this to the v0.17.0 milestone Dec 26, 2022
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.

Thank you for the fix! I have some improvements for it

boa_parser/src/parser/expression/update.rs Outdated Show resolved Hide resolved
boa_parser/src/parser/expression/update.rs Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Dec 26, 2022

Codecov Report

Merging #2507 (e0d9d9b) into main (f871697) will decrease coverage by 1.35%.
The diff coverage is 94.44%.

@@            Coverage Diff             @@
##             main    #2507      +/-   ##
==========================================
- Coverage   52.99%   51.64%   -1.36%     
==========================================
  Files         343      355      +12     
  Lines       34755    35619     +864     
==========================================
- Hits        18419    18396      -23     
- Misses      16336    17223     +887     
Impacted Files Coverage Δ
boa_parser/src/parser/expression/update.rs 92.06% <94.44%> (+14.79%) ⬆️
boa_engine/src/builtins/intl/date_time_format.rs 4.59% <0.00%> (-53.10%) ⬇️
boa_engine/src/context/icu.rs 39.58% <0.00%> (-14.97%) ⬇️
boa_gc/src/trace.rs 69.56% <0.00%> (-8.70%) ⬇️
boa_engine/src/context/mod.rs 61.78% <0.00%> (-4.56%) ⬇️
boa_engine/src/bytecompiler/expression/unary.rs 93.10% <0.00%> (-3.45%) ⬇️
boa_engine/src/object/mod.rs 44.22% <0.00%> (-2.32%) ⬇️
...arser/src/parser/expression/left_hand_side/call.rs 54.09% <0.00%> (-1.64%) ⬇️
boa_engine/src/builtins/string/mod.rs 59.66% <0.00%> (-1.59%) ⬇️
boa_engine/src/builtins/array/mod.rs 74.57% <0.00%> (-1.41%) ⬇️
... and 71 more

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

@jedel1043
Copy link
Member

Test262 conformance changes

Test result main count PR count difference
Total 94,188 94,188 0
Passed 70,164 70,164 0
Ignored 18,605 18,605 0
Failed 5,419 5,419 0
Panics 0 0 0
Conformance 74.49% 74.49% 0.00%

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.

Implementation-wise looks good! Can you add a test case on https://github.com/boa-dev/boa/blob/main/boa_engine/src/tests.rs? I thought the test262 suite would catch this, but apparently it doesn't...

@jedel1043
Copy link
Member

There are some failing checks. Can you run cargo fmt?

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 perfect to me!

@veera-sivarajan veera-sivarajan requested review from Razican and removed request for raskad, HalidOdat, jasonwilliams, RageKnify and nekevss December 28, 2022 16:40
Copy link
Member

@Razican Razican left a comment

Choose a reason for hiding this comment

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

It's good for me! Thank you for the changes!! :)

@Razican
Copy link
Member

Razican commented Dec 30, 2022

Bors r+

bors bot pushed a commit that referenced this pull request Dec 30, 2022
<!---
Thank you for contributing to Boa! Please fill out the template below, and remove or add any
information as you feel necessary.
--->

This Pull Request fixes/closes #2416.

Previously, prefix increment and decrement operations on `this` caused a panic. This PR makes the parser issue a syntax error when the operand UnaryExpression is not simple (as mentioned in https://tc39.es/ecma262/#sec-update-expressions-static-semantics-early-errors).
@bors
Copy link

bors bot commented Dec 30, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Fix unary operations on this [Merged by Bors] - Fix unary operations on this Dec 30, 2022
@bors bors bot closed this Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working parser Issues surrounding the parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic when using unary operations on this
3 participants