<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "JavaScriptCore",
  "identifier" : "/documentation/JavaScriptCore/JSObjectMakeDeferredPromise(_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "JavaScriptCore"
    ],
    "preciseIdentifier" : "c:@F@JSObjectMakeDeferredPromise"
  },
  "title" : "JSObjectMakeDeferredPromise(_:_:_:_:)"
}
-->

# JSObjectMakeDeferredPromise(_:_:_:_:)

Creates a JavaScript promise object by invoking the provided executor.

```
func JSObjectMakeDeferredPromise(_ ctx: JSContextRef!, _ resolve: UnsafeMutablePointer<JSObjectRef?>!, _ reject: UnsafeMutablePointer<JSObjectRef?>!, _ exception: UnsafeMutablePointer<JSValueRef?>!) -> JSObjectRef!
```

## Parameters

`ctx`

The execution context to use.

`resolve`

A pointer to a [`JSObjectRef`](/documentation/JavaScriptCore/JSObjectRef) to store the resolve function in for the new promise. Pass `NULL` if you don’t want to store the resolve callback.

`reject`

A pointer to a [`JSObjectRef`](/documentation/JavaScriptCore/JSObjectRef) to store the reject function in for the new promise. Pass `NULL` if you don’t want to store the reject callback.

`exception`

A pointer to a [`JSValueRef`](/documentation/JavaScriptCore/JSValueRef) to store an exception in, if any. Pass `NULL` to discard any exception.

## Return Value

A [`JSObjectRef`](/documentation/JavaScriptCore/JSObjectRef) that’s a promise, or `NULL` if an exception occurs.

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)