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

Add Object.defineProperties and handle props argument in Object.create #746

Merged
merged 3 commits into from
Oct 5, 2020
Merged

Add Object.defineProperties and handle props argument in Object.create #746

merged 3 commits into from
Oct 5, 2020

Conversation

dvtkrlbs
Copy link

@dvtkrlbs dvtkrlbs commented Oct 1, 2020

This Pull Request fixes/closes #552.

It changes the following:

  • It adds define_properties to both internal and external Object struct

@dvtkrlbs
Copy link
Author

dvtkrlbs commented Oct 1, 2020

I am looking for feedback on this. I might have missed some stuff since spec is kinda confusing

@dvtkrlbs dvtkrlbs marked this pull request as draft October 1, 2020 02:03
@codecov
Copy link

codecov bot commented Oct 1, 2020

Codecov Report

Merging #746 into master will increase coverage by 0.49%.
The diff coverage is 82.35%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #746      +/-   ##
==========================================
+ Coverage   59.15%   59.64%   +0.49%     
==========================================
  Files         155      155              
  Lines        9841     9970     +129     
==========================================
+ Hits         5821     5947     +126     
- Misses       4020     4023       +3     
Impacted Files Coverage Δ
boa/src/builtins/object/mod.rs 59.81% <68.42%> (+0.86%) ⬆️
boa/src/object/internal_methods.rs 55.34% <100.00%> (+4.65%) ⬆️
boa/src/syntax/lexer/identifier.rs 62.50% <0.00%> (-22.12%) ⬇️
boa/src/syntax/parser/function/mod.rs 67.69% <0.00%> (-3.74%) ⬇️
boa/src/syntax/parser/statement/mod.rs 54.08% <0.00%> (-2.35%) ⬇️
boa/src/value/mod.rs 71.57% <0.00%> (-0.72%) ⬇️
boa/src/syntax/parser/statement/switch/mod.rs 69.09% <0.00%> (ø)
boa/src/context.rs 70.67% <0.00%> (+0.53%) ⬆️
boa/src/syntax/lexer/number.rs 64.22% <0.00%> (+0.81%) ⬆️
boa/src/syntax/parser/cursor/buffered_lexer/mod.rs 85.91% <0.00%> (+0.84%) ⬆️
... and 15 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 d6c252d...ff8d2ff. Read the comment docs.

@dvtkrlbs dvtkrlbs marked this pull request as ready for review October 3, 2020 06:05
@dvtkrlbs
Copy link
Author

dvtkrlbs commented Oct 3, 2020

Ok i think this is ready for review now. I know that i did not add any tests but i have no idea on how to test this. So i could use some help there

@HalidOdat HalidOdat added builtins PRs and Issues related to builtins/intrinsics enhancement New feature or request labels Oct 3, 2020
@HalidOdat HalidOdat added this to the v0.11.0 milestone Oct 3, 2020
boa/src/builtins/object/mod.rs Outdated Show resolved Hide resolved
boa/src/builtins/object/mod.rs Outdated Show resolved Hide resolved
boa/src/builtins/object/mod.rs Outdated Show resolved Hide resolved
boa/src/builtins/object/mod.rs Outdated Show resolved Hide resolved
boa/src/builtins/object/mod.rs Outdated Show resolved Hide resolved
boa/src/object/internal_methods.rs Outdated Show resolved Hide resolved
boa/src/object/internal_methods.rs Outdated Show resolved Hide resolved
boa/src/builtins/object/mod.rs Outdated Show resolved Hide resolved
@RageKnify
Copy link
Member

@dvtkrlbs for a test you can look at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperties for an idea of how to test it.
I'd say to write the test in boa/src/builtins/object/tests.rs.

Copy link
Member

@RageKnify RageKnify left a comment

Choose a reason for hiding this comment

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

Adding 1 test should be enough to improve the coverage values.

@HalidOdat HalidOdat merged commit fb1b8d5 into boa-dev:master Oct 5, 2020
@dvtkrlbs dvtkrlbs deleted the object-define-properties branch October 5, 2020 23:58
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.

[builtins - Object] Object.defineProperties() not implemented
4 participants