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 getter and setter of Object.prototype.__proto__ #2110

Closed
wants to merge 2 commits into from

Conversation

CYBAI
Copy link
Contributor

@CYBAI CYBAI commented Jun 11, 2022

This Pull Request fixes part of #2067.

It changes the following:

  • implemented getter of Object.prototype.__proto__
  • implemented setter of Object.prototype.__proto__

I've tried to run tests with test262/test/built-ins/Object/prototype/__proto__/ and all tests under that directory are pass now 🙏

Toggle to see __proto__ test status
   Compiling boa_engine v0.15.0 (/codespace/rust/boa/boa_engine)
   Compiling boa_tester v0.15.0 (/codespace/rust/boa/boa_tester)
    Finished release [optimized] target(s) in 2m 57s
     Running `target/release/boa_tester run -vv -d -s /codespace/rust/boa/test262/test/built-ins/Object/prototype/__proto__/`
Loading the test suite...
Test suite loaded, starting tests...
Suite __proto__:
`get-fn-name` (strict mode): starting
`get-fn-name` (strict mode): Passed
`get-fn-name`: starting
`get-fn-name`: Passed
`set-cycle-shadowed` (strict mode): starting
`set-cycle-shadowed` (strict mode): Passed
`set-cycle-shadowed`: starting
`set-cycle-shadowed`: Passed
`set-abrupt` (strict mode): starting
`set-abrupt` (strict mode): Passed
`set-abrupt`: starting
`set-abrupt`: Passed
`get-to-obj-abrupt` (strict mode): starting
`get-to-obj-abrupt` (strict mode): Passed
`get-to-obj-abrupt`: starting
`get-to-obj-abrupt`: Passed
`set-fn-name` (strict mode): starting
`set-fn-name` (strict mode): Passed
`set-fn-name`: starting
`set-fn-name`: Passed
`get-ordinary-obj` (strict mode): starting
`get-ordinary-obj` (strict mode): Passed
`get-ordinary-obj`: starting
`get-ordinary-obj`: Passed
`set-non-object` (strict mode): starting
`set-non-object` (strict mode): Passed
`set-non-object`: starting
`set-non-object`: Passed
`set-invalid-value` (strict mode): starting
`set-invalid-value` (strict mode): Passed
`set-invalid-value`: starting
`set-invalid-value`: Passed
`set-immutable` (strict mode): starting
`set-immutable` (strict mode): Passed
`set-immutable`: starting
`set-immutable`: Passed
`set-non-obj-coercible` (strict mode): starting
`set-non-obj-coercible` (strict mode): Passed
`set-non-obj-coercible`: starting
`set-non-obj-coercible`: Passed
`set-cycle` (strict mode): starting
`set-cycle` (strict mode): Passed
`set-cycle`: starting
`set-cycle`: Passed
`prop-desc` (strict mode): starting
`prop-desc` (strict mode): Passed
`prop-desc`: starting
`prop-desc`: Passed
`get-abrupt` (strict mode): starting
`get-abrupt` (strict mode): Passed
`get-abrupt`: starting
`get-abrupt`: Passed
`set-ordinary-obj` (strict mode): starting
`set-ordinary-obj` (strict mode): Passed
`set-ordinary-obj`: starting
`set-ordinary-obj`: Passed
`set-non-extensible` (strict mode): starting
`set-non-extensible` (strict mode): Passed
`set-non-extensible`: starting
`set-non-extensible`: Passed

Suite __proto__ results: total: 30, passed: 30, ignored: 0, failed: 0 (panics: 0), conformance: 100.00%

Results:
Total tests: 30
Passed tests: 30
Ignored tests: 0
Failed tests: 0 (panics: 0)
Conformance: 100.00%

@codecov
Copy link

codecov bot commented Jun 11, 2022

Codecov Report

Merging #2110 (d51205d) into main (0eb771d) will decrease coverage by 0.01%.
The diff coverage is 23.52%.

@@            Coverage Diff             @@
##             main    #2110      +/-   ##
==========================================
- Coverage   43.64%   43.62%   -0.02%     
==========================================
  Files         217      217              
  Lines       19656    19673      +17     
==========================================
+ Hits         8578     8583       +5     
- Misses      11078    11090      +12     
Impacted Files Coverage Δ
boa_engine/src/builtins/object/mod.rs 59.91% <23.52%> (-2.69%) ⬇️
boa_engine/src/property/mod.rs 50.89% <0.00%> (+0.44%) ⬆️

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 0eb771d...d51205d. Read the comment docs.

@raskad
Copy link
Member

raskad commented Jun 11, 2022

VM implementation

Test result main count PR count difference
Total 90,499 90,499 0
Passed 56,416 56,446 +30
Ignored 23,580 23,580 0
Failed 10,503 10,473 -30
Panics 0 0 0
Conformance 62.34% 62.37% +0.03%
Fixed tests (30):
test/built-ins/Object/prototype/__proto__/get-to-obj-abrupt.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__proto__/get-to-obj-abrupt.js (previously Failed)
test/built-ins/Object/prototype/__proto__/set-cycle.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__proto__/set-cycle.js (previously Failed)
test/built-ins/Object/prototype/__proto__/set-cycle-shadowed.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__proto__/set-cycle-shadowed.js (previously Failed)
test/built-ins/Object/prototype/__proto__/get-ordinary-obj.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__proto__/get-ordinary-obj.js (previously Failed)
test/built-ins/Object/prototype/__proto__/set-fn-name.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__proto__/set-fn-name.js (previously Failed)
test/built-ins/Object/prototype/__proto__/set-abrupt.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__proto__/set-abrupt.js (previously Failed)
test/built-ins/Object/prototype/__proto__/set-non-object.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__proto__/set-non-object.js (previously Failed)
test/built-ins/Object/prototype/__proto__/set-immutable.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__proto__/set-immutable.js (previously Failed)
test/built-ins/Object/prototype/__proto__/set-non-obj-coercible.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__proto__/set-non-obj-coercible.js (previously Failed)
test/built-ins/Object/prototype/__proto__/prop-desc.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__proto__/prop-desc.js (previously Failed)
test/built-ins/Object/prototype/__proto__/get-fn-name.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__proto__/get-fn-name.js (previously Failed)
test/built-ins/Object/prototype/__proto__/set-non-extensible.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__proto__/set-non-extensible.js (previously Failed)
test/built-ins/Object/prototype/__proto__/set-invalid-value.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__proto__/set-invalid-value.js (previously Failed)
test/built-ins/Object/prototype/__proto__/get-abrupt.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__proto__/get-abrupt.js (previously Failed)
test/built-ins/Object/prototype/__proto__/set-ordinary-obj.js [strict mode] (previously Failed)
test/built-ins/Object/prototype/__proto__/set-ordinary-obj.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.

Looks great! Cargo doc just complains about these two unresolved doc links.

boa_engine/src/builtins/object/mod.rs Outdated Show resolved Hide resolved
boa_engine/src/builtins/object/mod.rs Outdated Show resolved Hide resolved
@raskad raskad added enhancement New feature or request builtins PRs and Issues related to builtins/intrinsics labels Jun 11, 2022
@raskad raskad added this to the v0.16.0 milestone Jun 11, 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.

LGTM!

@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 changes the following:

- implemented getter of `Object.prototype.__proto__`
- implemented setter of `Object.prototype.__proto__`

I've tried to run tests with `test262/test/built-ins/Object/prototype/__proto__/` and all tests under that directory are pass now 🙏 

<details>

<summary>Toggle to see __proto__ test status</summary>

```
   Compiling boa_engine v0.15.0 (/codespace/rust/boa/boa_engine)
   Compiling boa_tester v0.15.0 (/codespace/rust/boa/boa_tester)
    Finished release [optimized] target(s) in 2m 57s
     Running `target/release/boa_tester run -vv -d -s /codespace/rust/boa/test262/test/built-ins/Object/prototype/__proto__/`
Loading the test suite...
Test suite loaded, starting tests...
Suite __proto__:
`get-fn-name` (strict mode): starting
`get-fn-name` (strict mode): Passed
`get-fn-name`: starting
`get-fn-name`: Passed
`set-cycle-shadowed` (strict mode): starting
`set-cycle-shadowed` (strict mode): Passed
`set-cycle-shadowed`: starting
`set-cycle-shadowed`: Passed
`set-abrupt` (strict mode): starting
`set-abrupt` (strict mode): Passed
`set-abrupt`: starting
`set-abrupt`: Passed
`get-to-obj-abrupt` (strict mode): starting
`get-to-obj-abrupt` (strict mode): Passed
`get-to-obj-abrupt`: starting
`get-to-obj-abrupt`: Passed
`set-fn-name` (strict mode): starting
`set-fn-name` (strict mode): Passed
`set-fn-name`: starting
`set-fn-name`: Passed
`get-ordinary-obj` (strict mode): starting
`get-ordinary-obj` (strict mode): Passed
`get-ordinary-obj`: starting
`get-ordinary-obj`: Passed
`set-non-object` (strict mode): starting
`set-non-object` (strict mode): Passed
`set-non-object`: starting
`set-non-object`: Passed
`set-invalid-value` (strict mode): starting
`set-invalid-value` (strict mode): Passed
`set-invalid-value`: starting
`set-invalid-value`: Passed
`set-immutable` (strict mode): starting
`set-immutable` (strict mode): Passed
`set-immutable`: starting
`set-immutable`: Passed
`set-non-obj-coercible` (strict mode): starting
`set-non-obj-coercible` (strict mode): Passed
`set-non-obj-coercible`: starting
`set-non-obj-coercible`: Passed
`set-cycle` (strict mode): starting
`set-cycle` (strict mode): Passed
`set-cycle`: starting
`set-cycle`: Passed
`prop-desc` (strict mode): starting
`prop-desc` (strict mode): Passed
`prop-desc`: starting
`prop-desc`: Passed
`get-abrupt` (strict mode): starting
`get-abrupt` (strict mode): Passed
`get-abrupt`: starting
`get-abrupt`: Passed
`set-ordinary-obj` (strict mode): starting
`set-ordinary-obj` (strict mode): Passed
`set-ordinary-obj`: starting
`set-ordinary-obj`: Passed
`set-non-extensible` (strict mode): starting
`set-non-extensible` (strict mode): Passed
`set-non-extensible`: starting
`set-non-extensible`: Passed

Suite __proto__ results: total: 30, passed: 30, ignored: 0, failed: 0 (panics: 0), conformance: 100.00%

Results:
Total tests: 30
Passed tests: 30
Ignored tests: 0
Failed tests: 0 (panics: 0)
Conformance: 100.00%
```

</details>
@bors
Copy link

bors bot commented Jun 11, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Implement getter and setter of Object.prototype.__proto__ [Merged by Bors] - Implement getter and setter of Object.prototype.__proto__ Jun 11, 2022
@bors bors bot closed this Jun 11, 2022
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.

3 participants