Bug 250554

Summary: Provide public C API for accessing the state and result of a promise
Product: WebKit Reporter: Kasper Isager Dalsgarð <kasperisager>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: gorez.tony, mark.lam, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Mac (Apple Silicon)   
OS: macOS 13   

Kasper Isager Dalsgarð
Reported 2023-01-13 02:13:03 PST
The public JavaScriptCore C API is currently missing functions for accessing the state and result of a promise. The private C++ APIs are already there: https://github.com/WebKit/WebKit/blob/2c3591d6db31967955f974e615d986177db22774/Source/JavaScriptCore/runtime/JSPromise.h#L75-L76 It would also be great with a function for testing if a value is a promise, such as JSValueIsPromise().
Attachments
Radar WebKit Bug Importer
Comment 1 2023-01-20 02:14:15 PST
gorez.tony
Comment 2 2024-03-01 06:50:58 PST
We have the same issue here, the same concerns, be able to: - get the result of a promise or at least have a way to attach a resolve and reject callbacks when calling `JSObjectCallAsFunction` - have a JSValueIsPromise helper method
Note You need to log in before you can comment on or make changes to this bug.