Skip to content

feat(builtins): implement JsGeneratorFunction safe wrapper#4756

Merged
jedel1043 merged 3 commits intoboa-dev:mainfrom
KaustubhOG:feat/js-generator-function-wrapper
Feb 28, 2026
Merged

feat(builtins): implement JsGeneratorFunction safe wrapper#4756
jedel1043 merged 3 commits intoboa-dev:mainfrom
KaustubhOG:feat/js-generator-function-wrapper

Conversation

@KaustubhOG
Copy link
Contributor

Implements the JsGeneratorFunction safe Rust wrapper as part of #2098.

Adds core/engine/src/object/builtins/jsgeneratorfunction.rs with:

  • from_object(object: JsObject) -> JsResult<Self>
  • call(this, args, context) -> JsResult<JsValue>
  • From<JsGeneratorFunction> for JsObject and JsValue
  • Deref to JsObject
  • TryFromJs impl

GeneratorFunction has no JsData derive, so type detection uses
downcast_ref::<OrdinaryFunction>() and checks code.is_generator() && !code.is_async().

@KaustubhOG KaustubhOG requested a review from a team as a code owner February 28, 2026 09:54
@github-actions
Copy link

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%

@codecov
Copy link

codecov bot commented Feb 28, 2026

Codecov Report

❌ Patch coverage is 0% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.01%. Comparing base (6ddc2b4) to head (f7b0604).
⚠️ Report is 705 commits behind head on main.

Files with missing lines Patch % Lines
.../engine/src/object/builtins/jsgeneratorfunction.rs 0.00% 25 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4756      +/-   ##
==========================================
+ Coverage   47.24%   57.01%   +9.77%     
==========================================
  Files         476      553      +77     
  Lines       46892    60593   +13701     
==========================================
+ Hits        22154    34547   +12393     
- Misses      24738    26046    +1308     

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

@KaustubhOG KaustubhOG requested a review from jedel1043 February 28, 2026 17:30
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.

Very nice! Thank you!

@jedel1043 jedel1043 added this pull request to the merge queue Feb 28, 2026
@KaustubhOG
Copy link
Contributor Author

Hi @jedel1043, thank you for the quick review and guidance throughout these PRs — your feedback has been very clear and helpful. Really appreciate your support! thanks again ( whenever u get chance take a look at #4755 the only wrapper that is remaining in our original #2098 )

Merged via the queue into boa-dev:main with commit 4c0b609 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants