Skip to content

docs(interner): add code examples to boa_interner public API#4724

Merged
jedel1043 merged 6 commits intoboa-dev:mainfrom
KaustubhOG:add-interner-doc-examples
Feb 28, 2026
Merged

docs(interner): add code examples to boa_interner public API#4724
jedel1043 merged 6 commits intoboa-dev:mainfrom
KaustubhOG:add-interner-doc-examples

Conversation

@KaustubhOG
Copy link
Contributor

Closes #2337

Added # Examples doc sections to all 14 public functions in
core/interner/src/lib.rs, covering Interner and JSInternedStrRef.

PR #3141 added unit tests but left the public API without doc examples.
This PR completes the original intent of the issue.

Notable considerations:

  • is_empty() example reflects that a new interner is never empty due to
    pre-loaded COMMON_STRINGS_UTF8
  • len() uses initial_len pattern for the same reason
  • into_common() defines a local JsString enum since no standard type
    implements both From<&str> and From<&[u16]>

All 14 doctests pass (cargo +nightly test --doc).

@KaustubhOG KaustubhOG requested a review from a team as a code owner February 25, 2026 13:04
@github-actions
Copy link

github-actions bot commented Feb 25, 2026

Test262 conformance changes

Test result main count PR count difference
Total 52,862 52,862 0
Passed 49,505 49,505 0
Ignored 2,261 2,261 0
Failed 1,096 1,096 0
Panics 0 0 0
Conformance 93.65% 93.65% 0.00%

@nekevss nekevss added the documentation update documentation label Feb 26, 2026
@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.10%. Comparing base (6ddc2b4) to head (c1629de).
⚠️ Report is 710 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4724      +/-   ##
==========================================
+ Coverage   47.24%   57.10%   +9.85%     
==========================================
  Files         476      553      +77     
  Lines       46892    60603   +13711     
==========================================
+ Hits        22154    34606   +12452     
- Misses      24738    25997    +1259     

☔ 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.

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 to me!

@KaustubhOG
Copy link
Contributor Author

KaustubhOG commented Feb 28, 2026

Looks good to me!

thanks @jedel1043 tbh i enjoyed this because it was my first PR i raised in boa

@jedel1043 jedel1043 added this pull request to the merge queue Feb 28, 2026
Merged via the queue into boa-dev:main with commit 27959b2 Feb 28, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation update documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add code examples for boa_interner

3 participants