Skip to content

Implement Set methods from ECMAScript Specification Features/#4128 #4145

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
merged 19 commits into from
May 21, 2025

Conversation

Hemenguelbindi
Copy link
Contributor

This Pull Request fixes/closes #{issue_num}.

It changes the following:

  • Implemented the Set methods from the ECMAScript specification
    • Set.prototype.difference(other)
    • Set.prototype.intersection(other)
    • Set.prototype.isDisjointFrom(other)
    • Set.prototype.isSubsetOf(other)
    • Set.prototype.isSupersetOf(other)
    • Set.prototype.symmetricDifference(other)
    • Set.prototype.union(other)
  • Added test cases for all newly implemented methods to ensure specification compliance.
  • Updated relevant documentation and comments for clarity.

Additional Information:
This implementation aligns with the ECMAScript specification, section 24.2.4, and follows the behavior described in the Set Methods Proposal. Test coverage includes edge cases such as empty sets, overlapping sets, and disjoint sets.

Feel free to let me know if there are areas for improvement or adjustments!

Copy link

codecov bot commented Jan 26, 2025

Codecov Report

Attention: Patch coverage is 74.66667% with 38 lines in your changes missing coverage. Please review.

Project coverage is 53.24%. Comparing base (6ddc2b4) to head (4b8e84a).
Report is 415 commits behind head on main.

Files with missing lines Patch % Lines
core/engine/src/builtins/set/mod.rs 74.66% 38 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4145      +/-   ##
==========================================
+ Coverage   47.24%   53.24%   +6.00%     
==========================================
  Files         476      487      +11     
  Lines       46892    50311    +3419     
==========================================
+ Hits        22154    26790    +4636     
+ Misses      24738    23521    -1217     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nekevss
Copy link
Member

nekevss commented Jan 26, 2025

This is looking great so far!

It looks like you may need to run cargo fmt --all

Also, if you remove set-methods from the test262_config.toml, then you should be able to run the Set built-in test262 suite with boa_tester:

cargo run --release --bin boa_tester -- run -vv -s test/built-ins/Set/prototype

If you want more verbose feedback, you can run:

cargo run --release --bin boa_tester -- run -vvv -s test/built-ins/Set/prototype

Adding the specific method on the end of the path can target that specific method.

@Hemenguelbindi
Copy link
Contributor Author

i am done all fix need this issus #4128

@nekevss nekevss requested a review from a team January 30, 2025 17:37
@nekevss nekevss added enhancement New feature or request builtins PRs and Issues related to builtins/intrinsics labels Jan 30, 2025
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.

This is looking great so far!

Have some general feedback to help increase test coverage on the implementation and a typo.

@nekevss nekevss requested a review from a team February 1, 2025 05:01
@jedel1043 jedel1043 added the waiting-on-author Waiting on PR changes from the author label Feb 26, 2025
…e comment on using GetSetRecord in difference, nit: rename to is_disjoint_from, suggestion: use GetSetRecord abstract op

See review comment on difference method.

,
@Hemenguelbindi
Copy link
Contributor Author

I'm sorry that I've been missing for so long, there were too many blockages at work, so I fixed everything according to your recommendations, and also divided the test logic for some tests.

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.

Thanks for working on this!!!

@nekevss nekevss added this pull request to the merge queue May 21, 2025
Merged via the queue into boa-dev:main with commit 3f6979b May 21, 2025
15 checks passed
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 waiting-on-author Waiting on PR changes from the author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants