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] - Implement Object.prototype.__defineGetter__ #2108

Closed
wants to merge 1 commit into from

Conversation

CYBAI
Copy link
Contributor

@CYBAI CYBAI commented Jun 10, 2022

This Pull Request fixes part of #2067.

It introduces the legacy Object.prototype.__defineGetter__ function.

@Razican Razican added this to the v0.16.0 milestone Jun 10, 2022
@Razican Razican added enhancement New feature or request builtins PRs and Issues related to builtins/intrinsics labels Jun 10, 2022
@codecov
Copy link

codecov bot commented Jun 10, 2022

Codecov Report

Merging #2108 (432ee3f) into main (5002b9b) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #2108      +/-   ##
==========================================
- Coverage   43.66%   43.65%   -0.02%     
==========================================
  Files         217      217              
  Lines       19644    19649       +5     
==========================================
  Hits         8578     8578              
- Misses      11066    11071       +5     
Impacted Files Coverage Δ
boa_engine/src/builtins/object/mod.rs 64.57% <0.00%> (-2.10%) ⬇️
boa_engine/src/syntax/ast/node/spread/mod.rs 57.14% <0.00%> (-14.29%) ⬇️
...x/ast/node/declaration/async_generator_decl/mod.rs 6.66% <0.00%> (-6.67%) ⬇️
...ntax/parser/expression/left_hand_side/arguments.rs 35.00% <0.00%> (-2.50%) ⬇️
boa_engine/src/vm/code_block.rs 45.81% <0.00%> (ø)
boa_engine/src/syntax/ast/node/mod.rs 48.85% <0.00%> (ø)
boa_engine/src/syntax/ast/node/new/mod.rs 37.50% <0.00%> (ø)
boa_engine/src/syntax/ast/node/call/mod.rs 69.23% <0.00%> (ø)
boa_engine/src/syntax/ast/node/array/mod.rs 33.33% <0.00%> (ø)
boa_engine/src/syntax/ast/node/block/mod.rs 50.00% <0.00%> (ø)
... and 37 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5002b9b...432ee3f. Read the comment docs.

@Razican
Copy link
Member

Razican commented Jun 10, 2022

VM implementation

Test result main count PR count difference
Total 90,499 90,499 0
Passed 56,372 56,394 +22
Ignored 23,580 23,580 0
Failed 10,547 10,525 -22
Panics 0 0 0
Conformance 62.29% 62.31% +0.02%
Fixed tests (22):
test/built-ins/Object/prototype/__defineGetter__/key-invalid.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__defineGetter__/key-invalid.js (previously Failed)
test/built-ins/Object/prototype/__defineGetter__/this-non-obj.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__defineGetter__/this-non-obj.js (previously Failed)
test/built-ins/Object/prototype/__defineGetter__/define-existing.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__defineGetter__/define-existing.js (previously Failed)
test/built-ins/Object/prototype/__defineGetter__/define-non-extensible.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__defineGetter__/define-non-extensible.js (previously Failed)
test/built-ins/Object/prototype/__defineGetter__/define-new.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__defineGetter__/define-new.js (previously Failed)
test/built-ins/Object/prototype/__defineGetter__/length.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__defineGetter__/length.js (previously Failed)
test/built-ins/Object/prototype/__defineGetter__/name.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__defineGetter__/name.js (previously Failed)
test/built-ins/Object/prototype/__defineGetter__/prop-desc.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__defineGetter__/prop-desc.js (previously Failed)
test/built-ins/Object/prototype/__defineGetter__/define-abrupt.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__defineGetter__/define-abrupt.js (previously Failed)
test/built-ins/Object/prototype/__defineGetter__/getter-non-callable.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__defineGetter__/getter-non-callable.js (previously Failed)
test/built-ins/Object/prototype/__defineGetter__/define-non-configurable.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__defineGetter__/define-non-configurable.js (previously Failed)

Copy link
Member

@raskad raskad 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 your contribution :)

I only have one small difference from the spec that should be fixed. Also we like to have the steps from the spec written as comments in the code (when it makes sense). For example:

// 1. Let O be ? ToObject(this value).
let obj = this.to_object(context)?;

It would be great if you could add those.

boa_engine/src/builtins/object/mod.rs Outdated Show resolved Hide resolved
@CYBAI CYBAI requested a review from raskad June 10, 2022 23:32
Copy link
Member

@raskad raskad left a comment

Choose a reason for hiding this comment

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

Looks great! All tests in the built-ins/Object/prototype/__defineGetter__ suite pass :)

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 good!

@jedel1043
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Jun 11, 2022
This Pull Request fixes part of #2067.

It introduces the legacy `Object.prototype.__defineGetter__` function.
@bors
Copy link

bors bot commented Jun 11, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Implement Object.prototype.__defineGetter__ [Merged by Bors] - Implement Object.prototype.__defineGetter__ Jun 11, 2022
@bors bors bot closed this Jun 11, 2022
@CYBAI CYBAI deleted the legacy-obj-define-getter branch June 11, 2022 02:01
@CYBAI
Copy link
Contributor Author

CYBAI commented Jun 11, 2022

Thank you for the review! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builtins PRs and Issues related to builtins/intrinsics enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants