Bug 308686

Summary: JSNativeStdFunction should be able to safely capture
Product: WebKit Reporter: Kai Tamkun <k_tamkun>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Kai Tamkun
Reported 2026-02-25 17:07:01 PST
Currently, there's no way to safely keep the captures of lambdas passed to JSNativeStdFunction::create alive other than use of Strong, which has its own problems. If JSNativeStdFunction kept a FixedVector of WriteBarriers to captured values, it could keep them alive at least as long as the JSNativeStdFunction is alive without Strong cycle issues.
Attachments
Radar WebKit Bug Importer
Comment 1 2026-02-25 17:07:30 PST
Kai Tamkun
Comment 2 2026-02-25 17:10:18 PST
EWS
Comment 3 2026-03-02 10:11:18 PST
Committed 308472@main (8ed6b76ec394): <https://commits.webkit.org/308472@main> Reviewed commits have been landed. Closing PR #59467 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.