Bug 250554 - Provide public C API for accessing the state and result of a promise
Summary: Provide public C API for accessing the state and result of a promise
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Local Build
Hardware: Mac (Apple Silicon) macOS 13
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-01-13 02:13 PST by Kasper Isager Dalsgarð
Modified: 2024-03-01 06:50 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kasper Isager Dalsgarð 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().
Comment 1 Radar WebKit Bug Importer 2023-01-20 02:14:15 PST
<rdar://problem/104469141>
Comment 2 gorez.tony 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