-
Notifications
You must be signed in to change notification settings - Fork 1.2k
JsHostPromiseRejectionTrackerCallback
A Promise Rejection Tracker callback.
typedef void (CHAKRA_CALLBACK *JsHostPromiseRejectionTrackerCallback)(_In_ JsValueRef promise, _In_ JsValueRef reason, _In_ bool handled, _In_opt_ void *callbackState);
- promise: The promise object, represented as a JsValueRef.
- reason: The value/cause of the rejection, represented as a JsValueRef.
- handled: Boolean - false for promiseRejected: i.e. if the promise has just been rejected with no handler, true for promiseHandled: i.e. if it was rejected before without a handler and is now being handled.
- callbackState: The state passed to JsSetHostPromiseRejectionTracker.
The host can specify a promise rejection tracker callback in JsSetHostPromiseRejectionTracker. If a promise is rejected with no reactions or a reaction is added to a promise that was rejected before it had reactions by default nothing is done. A Promise Rejection Tracker callback may be set - which will then be called when this occurs. Note - per ECMASpec #sec-host-promise-rejection-tracker this function should not set or return an exception. Note also the promise and reason parameters may be garbage collected after this function is called if you wish to make further use of them you will need to use JsAddRef to preserve them. However if you use JsAddRef you must also call JsRelease and not hold onto them after a handled notification (both per spec and to avoid memory leaks).
- Architecture Overview
- Building ChakraCore
- ChakraCore Code Structure
- Contributor Guidance
- Engineering Notes
- Embedding ChakraCore
- Testing ChakraCore
- Getting ChakraCore binaries
- Label Glossary
- Resources
- Roadmap / Release Notes
Want to contribute to this Wiki? Fork it and send a pull request!