Skip to content

feat(error): harden JsNativeError public API surface#5012

Merged
jedel1043 merged 1 commit intoboa-dev:mainfrom
alienx5499:feat/4981-harden-jsnativeerror
Mar 12, 2026
Merged

feat(error): harden JsNativeError public API surface#5012
jedel1043 merged 1 commit intoboa-dev:mainfrom
alienx5499:feat/4981-harden-jsnativeerror

Conversation

@alienx5499
Copy link
Contributor

This Pull Request fixes/closes #4981.

It changes the following:

  • Make JsNativeError::kind a private field instead of pub.
  • Add a JsNativeError::kind(&self) -> &JsNativeErrorKind accessor as the stable API.
  • Update internal usages (engine tests, runtime tests, URI tests, tester helpers, docs/examples) to call kind() instead of reading the field directly.

Testing:

  • cargo test -p boa_engine

@alienx5499 alienx5499 requested a review from a team as a code owner March 12, 2026 13:44
@github-actions
Copy link

Test262 conformance changes

Test result main count PR count difference
Total 52,963 52,963 0
Passed 49,901 49,901 0
Ignored 2,222 2,222 0
Failed 840 840 0
Panics 0 0 0
Conformance 94.22% 94.22% 0.00%

Tested main commit: a49348586d90b790936dc6ab651da6aff3f60e67
Tested PR commit: 07f3eaacdf3fb60b47c4b250c51d2de7624e0d4b
Compare commits: a493485...07f3eaa

@codecov
Copy link

codecov bot commented Mar 12, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 58.39%. Comparing base (6ddc2b4) to head (07f3eaa).
⚠️ Report is 808 commits behind head on main.

Files with missing lines Patch % Lines
tests/tester/src/exec/mod.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5012       +/-   ##
===========================================
+ Coverage   47.24%   58.39%   +11.14%     
===========================================
  Files         476      559       +83     
  Lines       46892    61406    +14514     
===========================================
+ Hits        22154    35855    +13701     
- Misses      24738    25551      +813     

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

Cool, thank you!

@jedel1043 jedel1043 added this pull request to the merge queue Mar 12, 2026
@jedel1043 jedel1043 added the A-API Changes related to public APIs label Mar 12, 2026
@jedel1043 jedel1043 added this to the v1.0.0 milestone Mar 12, 2026
Merged via the queue into boa-dev:main with commit c0a01d4 Mar 12, 2026
19 checks passed
MayankRaj435 pushed a commit to MayankRaj435/boa that referenced this pull request Mar 12, 2026
This Pull Request fixes/closes boa-dev#4981.

It changes the following:

* Make `JsNativeError::kind` a private field instead of `pub`.
* Add a `JsNativeError::kind(&self) -> &JsNativeErrorKind` accessor as
the stable API.
* Update internal usages (engine tests, runtime tests, URI tests, tester
helpers, docs/examples) to call `kind()` instead of reading the field
directly.

Testing:

* `cargo test -p boa_engine`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-API Changes related to public APIs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Public API surface: harden JsNativeError

2 participants