Skip to content

[Merged by Bors] - Implement Object.prototype.__defineGetter__ - #2108

Closed
CYBAI wants to merge 1 commit into
boa-dev:mainfrom
CYBAI:legacy-obj-define-getter
Closed

CYBAI wants to merge 1 commit into
boa-dev:mainfrom
CYBAI:legacy-obj-define-getter

Conversation

@CYBAI

@CYBAI CYBAI commented Jun 10, 2022

Copy link
Copy Markdown
Contributor

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 A-Enhancement New feature or request C-Builtins PRs and Issues related to builtins/intrinsics labels Jun 10, 2022
@codecov

codecov Bot commented Jun 10, 2022 •

Copy link
Copy Markdown

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

Razican commented Jun 10, 2022 •

Copy link
Copy Markdown
Member

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)

@raskad raskad left a comment

Copy link
Copy Markdown
Member

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.

Comment thread boa_engine/src/builtins/object/mod.rs Resolved
@CYBAI
CYBAI force-pushed the legacy-obj-define-getter branch from 5ebb24c to 7131ffc Compare June 10, 2022 23:28
@CYBAI
CYBAI force-pushed the legacy-obj-define-getter branch from 7131ffc to 432ee3f Compare June 10, 2022 23:30
@CYBAI
CYBAI requested a review from raskad June 10, 2022 23:32

@raskad raskad left a comment

Copy link
Copy Markdown
Member

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 :)

@jedel1043 jedel1043 left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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

bors Bot commented Jun 11, 2022

Copy link
Copy Markdown

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

CYBAI commented Jun 11, 2022

Copy link
Copy Markdown
Contributor Author

Thank you for the review! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Enhancement New feature or request C-Builtins PRs and Issues related to builtins/intrinsics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants