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 error for static class methods named prototype #2552

Closed
wants to merge 1 commit into from

Conversation

raskad
Copy link
Member

@raskad raskad commented Jan 21, 2023

This Pull Request changes the following:

  • Remove wrong early errors for static class methods with the computed property name prototype.
  • Switch static class method definition opcodes from __define_own_property__ to define_property_or_throw to correctly throw runtime errors on property redefinitions.

@raskad raskad added bug Something isn't working parser Issues surrounding the parser vm Issues and PRs related to the Boa Virtual Machine. labels Jan 21, 2023
@raskad raskad added this to the v0.17.0 milestone Jan 21, 2023
@github-actions
Copy link

Test262 conformance changes

Test result main count PR count difference
Total 94,205 94,205 0
Passed 70,624 70,640 +16
Ignored 18,622 18,622 0
Failed 4,959 4,943 -16
Panics 0 0 0
Conformance 74.97% 74.99% +0.02%
Fixed tests (16):
test/language/computed-property-names/class/static/setter-prototype.js [strict mode] (previously Failed)
test/language/computed-property-names/class/static/setter-prototype.js (previously Failed)
test/language/computed-property-names/class/static/getter-prototype.js [strict mode] (previously Failed)
test/language/computed-property-names/class/static/getter-prototype.js (previously Failed)
test/language/computed-property-names/class/static/generator-prototype.js [strict mode] (previously Failed)
test/language/computed-property-names/class/static/generator-prototype.js (previously Failed)
test/language/computed-property-names/class/static/method-prototype.js [strict mode] (previously Failed)
test/language/computed-property-names/class/static/method-prototype.js (previously Failed)
test/language/statements/class/static-method-non-configurable-err.js [strict mode] (previously Failed)
test/language/statements/class/static-method-non-configurable-err.js (previously Failed)
test/language/statements/class/static-method-gen-non-configurable-err.js [strict mode] (previously Failed)
test/language/statements/class/static-method-gen-non-configurable-err.js (previously Failed)
test/language/statements/class/definition/getters-non-configurable-err.js [strict mode] (previously Failed)
test/language/statements/class/definition/getters-non-configurable-err.js (previously Failed)
test/language/statements/class/definition/setters-non-configurable-err.js [strict mode] (previously Failed)
test/language/statements/class/definition/setters-non-configurable-err.js (previously Failed)

@codecov
Copy link

codecov bot commented Jan 21, 2023

Codecov Report

Merging #2552 (a5eef49) into main (f19467a) will decrease coverage by 0.01%.
The diff coverage is 15.00%.

@@            Coverage Diff             @@
##             main    #2552      +/-   ##
==========================================
- Coverage   49.99%   49.98%   -0.01%     
==========================================
  Files         379      379              
  Lines       37642    37639       -3     
==========================================
- Hits        18819    18814       -5     
- Misses      18823    18825       +2     
Impacted Files Coverage Δ
boa_engine/src/vm/opcode/define/class/getter.rs 0.00% <0.00%> (ø)
boa_engine/src/vm/opcode/define/class/method.rs 0.00% <0.00%> (ø)
boa_engine/src/vm/opcode/define/class/setter.rs 0.00% <0.00%> (ø)
.../statement/declaration/hoistable/class_decl/mod.rs 52.37% <17.64%> (-0.20%) ⬇️
boa_engine/src/vm/mod.rs 48.75% <0.00%> (-1.00%) ⬇️
boa_parser/src/lexer/cursor.rs 87.67% <0.00%> (-0.48%) ⬇️
boa_engine/src/value/display.rs 87.31% <0.00%> (+0.74%) ⬆️

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

Copy link
Member

@nekevss nekevss left a comment

Choose a reason for hiding this comment

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

Looks good to me 😄

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.

LGTM

@jedel1043
Copy link
Member

bors r+

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

- Remove wrong early errors for static class methods with the computed property name `prototype`.
- Switch static class method definition opcodes from `__define_own_property__` to `define_property_or_throw` to correctly throw runtime errors on property redefinitions.
@bors
Copy link

bors bot commented Jan 23, 2023

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Fix error for static class methods named prototype [Merged by Bors] - Fix error for static class methods named prototype Jan 23, 2023
@bors bors bot closed this Jan 23, 2023
@bors bors bot deleted the fix-class-static-method-name-prototype branch January 23, 2023 07:46
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 vm Issues and PRs related to the Boa Virtual Machine.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants