struct OpaqueJSClass * JSClassRef
Definition JSBase.h:52
struct OpaqueJSString * JSStringRef
Definition JSBase.h:49
struct OpaqueJSValue * JSObjectRef
Definition JSBase.h:69
const struct OpaqueJSValue * JSValueRef
Definition JSBase.h:66
struct OpaqueJSPropertyNameArray * JSPropertyNameArrayRef
Definition JSBase.h:55
struct OpaqueJSPropertyNameAccumulator * JSPropertyNameAccumulatorRef
Definition JSBase.h:58
#define JS_EXPORT
Definition JSBase.h:93
const struct OpaqueJSContext * JSContextRef
Definition JSBase.h:43
JSPropertyNameArrayRef JSPropertyNameArrayRetain(JSPropertyNameArrayRef array)
Retains a JavaScript property name array.
bool(*) JSObjectDeletePropertyCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception)
The callback invoked when deleting a property.
Definition JSObjectRef.h:204
JSValueRef JSPromiseGetResult(JSContextRef ctx, JSObjectRef promise)
Gets the settled result of a JavaScript Promise: its value if fulfilled, or its rejection reason if r...
JSObjectRef(*) JSObjectCallAsConstructorCallbackEx(JSContextRef ctx, JSClassRef jsClass, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef *exception)
Definition JSObjectRef.h:306
const JSClassDefinition kJSClassDefinitionEmpty
A JSClassDefinition structure of the current version, filled with NULL pointers and having no attribu...
JSValueRef JSObjectGetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception)
Gets a property from an object.
JSObjectRef JSObjectMakeConstructor(JSContextRef ctx, JSClassRef jsClass, JSObjectCallAsConstructorCallback callAsConstructor)
Convenience method for creating a JavaScript constructor.
bool JSClassSetPrivate(JSClassRef jsClass, void *data)
Sets the private data for a JSClass (version 1000 only).
JSValueRef JSObjectGetPrototype(JSContextRef ctx, JSObjectRef object)
Gets an object's prototype.
JSValueRef(*) JSObjectConvertToTypeCallbackEx(JSContextRef ctx, JSClassRef jsClass, JSObjectRef object, JSType type, JSValueRef *exception)
Definition JSObjectRef.h:354
void JSPropertyNameArrayRelease(JSPropertyNameArrayRef array)
Releases a JavaScript property name array.
JSValueRef(*) JSObjectGetPropertyCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception)
The callback invoked when getting a property's value.
Definition JSObjectRef.h:161
void * JSClassGetPrivate(JSClassRef jsClass)
Gets the private data from a JSClass (version 1000 only).
void(*) JSObjectFinalizeCallback(JSObjectRef object)
The callback invoked when an object is finalized (prepared for garbage collection)....
Definition JSObjectRef.h:116
void(*) JSObjectInitializeCallback(JSContextRef ctx, JSObjectRef object)
The callback invoked when an object is first created.
Definition JSObjectRef.h:94
JSValueRef JSObjectGetPropertyForKey(JSContextRef ctx, JSObjectRef object, JSValueRef propertyKey, JSValueRef *exception) JSC_API_AVAILABLE(macos(10.15)
Gets a property from an object using a JSValueRef as the property key.
bool JSObjectDefinePropertyUTF8(JSContextRef ctx, JSObjectRef object, const char *name, JSValueRef value, unsigned attributes, JSValueRef *exception)
Defines an own data property on an object with the given attributes, equivalent to Object....
JSValueRef JSObjectCallAsFunction(JSContextRef ctx, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef *exception)
Calls an object as a function.
JSObjectRef(*) JSObjectCallAsConstructorCallback(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef *exception)
The callback invoked when an object is used as a constructor in a 'new' expression.
Definition JSObjectRef.h:302
JSObjectRef JSObjectMakeArray(JSContextRef ctx, size_t argumentCount, const JSValueRef arguments[], JSValueRef *exception) JSC_API_AVAILABLE(macos(10.6)
Creates a JavaScript Array object.
void * JSObjectGetPrivate(JSObjectRef object)
Gets an object's private data.
bool JSObjectDeletePropertyForKey(JSContextRef ctx, JSObjectRef object, JSValueRef propertyKey, JSValueRef *exception) JSC_API_AVAILABLE(macos(10.15)
Deletes a property from an object using a JSValueRef as the property key.
JSPromiseStatus
The possible states of a JavaScript Promise.
Definition JSObjectRef.h:1056
@ kJSPromiseStatus_Rejected
Definition JSObjectRef.h:1059
@ kJSPromiseStatus_Fulfilled
Definition JSObjectRef.h:1058
@ kJSPromiseStatus_Pending
Definition JSObjectRef.h:1057
void(*) JSObjectGetPropertyNamesCallbackEx(JSContextRef ctx, JSClassRef jsClass, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames)
Definition JSObjectRef.h:229
bool(*) JSObjectHasInstanceCallback(JSContextRef ctx, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef *exception)
hasInstance The callback invoked when an object is used as the target of an 'instanceof' expression.
Definition JSObjectRef.h:327
JSObjectRef JSObjectMakeFunction(JSContextRef ctx, JSStringRef name, unsigned parameterCount, const JSStringRef parameterNames[], JSStringRef body, JSStringRef sourceURL, int startingLineNumber, JSValueRef *exception)
Creates a function with a given script as its body.
JSValueRef(*) JSObjectGetPropertyCallbackEx(JSContextRef ctx, JSClassRef jsClass, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception)
Definition JSObjectRef.h:165
bool(*) JSObjectHasPropertyCallbackEx(JSContextRef ctx, JSClassRef jsClass, JSObjectRef object, JSStringRef propertyName)
Definition JSObjectRef.h:144
bool(*) JSObjectHasInstanceCallbackEx(JSContextRef ctx, JSClassRef jsClass, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef *exception)
Definition JSObjectRef.h:331
void(*) JSFunctionDataFinalizeCallback(void *userData)
The callback invoked when a function created with JSObjectMakeFunctionWithData is garbage collected.
Definition JSObjectRef.h:282
void JSObjectSetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSPropertyAttributes attributes, JSValueRef *exception)
Sets a property on an object.
bool JSPromiseGetStatus(JSContextRef ctx, JSObjectRef promise, JSPromiseStatus *outStatus)
Gets the state of a JavaScript Promise without scheduling any reaction.
bool JSObjectSetExternalMemoryHint(JSContextRef ctx, JSObjectRef object, size_t bytes)
Reports the amount of non-JavaScript memory kept alive by an object, to guide garbage collection.
bool(*) JSObjectHasPropertyCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName)
The callback invoked when determining whether an object has a property.
Definition JSObjectRef.h:140
void JSObjectSetPropertyForKey(JSContextRef ctx, JSObjectRef object, JSValueRef propertyKey, JSValueRef value, JSPropertyAttributes attributes, JSValueRef *exception) JSC_API_AVAILABLE(macos(10.15)
Sets a property on an object using a JSValueRef as the property key.
bool JSPromiseMarkAsHandled(JSContextRef ctx, JSObjectRef promise)
Marks a JavaScript Promise as handled for unhandled-rejection reporting.
size_t JSPropertyNameArrayGetCount(JSPropertyNameArrayRef array)
Gets a count of the number of items in a JavaScript property name array.
void JSObjectSetPropertyAtIndex(JSContextRef ctx, JSObjectRef object, unsigned propertyIndex, JSValueRef value, JSValueRef *exception)
Sets a property on an object by numeric index.
unsigned JSPropertyAttributes
A set of JSPropertyAttributes. Combine multiple attributes by logically ORing them together.
Definition JSObjectRef.h:63
JSValueRef(*) JSObjectCallAsFunctionDataCallback(JSContextRef ctx, void *userData, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef *exception)
The callback invoked when a function created with JSObjectMakeFunctionWithData is called.
Definition JSObjectRef.h:269
bool JSObjectGetPropertiesUTF8(JSContextRef ctx, JSObjectRef object, const char *const *names, size_t count, JSValueRef *outValues, JSValueRef *exception)
Gets multiple properties of an object in one call, using UTF-8 property names.
bool JSObjectHasPropertyForKey(JSContextRef ctx, JSObjectRef object, JSValueRef propertyKey, JSValueRef *exception) JSC_API_AVAILABLE(macos(10.15)
Tests whether an object has a given property using a JSValueRef as the property key.
JSObjectRef JSObjectMakeRegExp(JSContextRef ctx, size_t argumentCount, const JSValueRef arguments[], JSValueRef *exception) JSC_API_AVAILABLE(macos(10.6)
Creates a JavaScript RegExp object, as if by invoking the built-in RegExp constructor.
JSClassRef JSClassCreate(const JSClassDefinition *definition)
Creates a JavaScript class suitable for use with JSObjectMake.
JSObjectRef JSObjectMake(JSContextRef ctx, JSClassRef jsClass, void *data)
Creates a JavaScript object.
bool(*) JSObjectDeletePropertyCallbackEx(JSContextRef ctx, JSClassRef jsClass, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception)
Definition JSObjectRef.h:208
bool JSObjectIsConstructor(JSContextRef ctx, JSObjectRef object)
Tests whether an object can be called as a constructor.
void(*) JSObjectFinalizeCallbackEx(JSClassRef jsClass, JSObjectRef object)
Definition JSObjectRef.h:120
void JSPropertyNameAccumulatorAddName(JSPropertyNameAccumulatorRef accumulator, JSStringRef propertyName)
Adds a property name to a JavaScript property name accumulator.
JSStringRef JSPropertyNameArrayGetNameAtIndex(JSPropertyNameArrayRef array, size_t index)
Gets a property name at a given index in a JavaScript property name array.
void JSClassRelease(JSClassRef jsClass)
Releases a JavaScript class.
JSValueRef(*) JSObjectCallAsFunctionCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef *exception)
The callback invoked when an object is called as a function.
Definition JSObjectRef.h:250
JSValueRef(*) JSObjectCallAsFunctionCallbackEx(JSContextRef ctx, JSClassRef jsClass, JSStringRef className, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef *exception)
Definition JSObjectRef.h:254
bool JSObjectDeleteProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception)
Deletes a property from an object.
@ kJSClassAttributeNone
Definition JSObjectRef.h:71
@ kJSClassAttributeNoAutomaticPrototype
Definition JSObjectRef.h:72
void JSObjectSetPrototype(JSContextRef ctx, JSObjectRef object, JSValueRef value)
Sets an object's prototype.
bool JSObjectGetOwnEntriesUTF8(JSContextRef ctx, JSObjectRef object, size_t start, JSStringRef *outNames, JSValueRef *outValues, size_t capacity, size_t *outCount, JSValueRef *exception)
Gets an object's own enumerable string-keyed properties (names and values) in one call.
bool JSObjectDefineAccessorUTF8(JSContextRef ctx, JSObjectRef object, const char *name, JSObjectRef getter, JSObjectRef setter, unsigned attributes, JSValueRef *exception)
Defines an accessor (getter/setter) property on an object, using a UTF-8 property name.
JSObjectRef JSObjectCallAsConstructor(JSContextRef ctx, JSObjectRef object, size_t argumentCount, const JSValueRef arguments[], JSValueRef *exception)
Calls an object as a constructor.
bool JSObjectIsFunction(JSContextRef ctx, JSObjectRef object)
Tests whether an object can be called as a function.
JSObjectRef JSObjectMakeWithPropertiesUTF8(JSContextRef ctx, const char *const *names, const JSValueRef *values, size_t count, JSValueRef *exception)
Creates a JavaScript object initialized with a set of properties, using UTF-8 property names.
JSObjectRef JSObjectMakeFunctionWithData(JSContextRef ctx, JSStringRef name, JSObjectCallAsFunctionDataCallback callAsFunction, void *userData, JSFunctionDataFinalizeCallback finalize)
Creates a JavaScript function with a callback, a user data pointer, and an optional finalizer.
JSPropertyNameArrayRef JSObjectCopyPropertyNames(JSContextRef ctx, JSObjectRef object)
Gets the names of an object's enumerable properties.
void(*) JSObjectGetPropertyNamesCallback(JSContextRef ctx, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames)
The callback invoked when collecting the names of an object's properties.
Definition JSObjectRef.h:225
JSValueRef JSObjectGetPropertyAtIndex(JSContextRef ctx, JSObjectRef object, unsigned propertyIndex, JSValueRef *exception)
Gets a property from an object by numeric index.
unsigned JSClassAttributes
A set of JSClassAttributes. Combine multiple attributes by logically ORing them together.
Definition JSObjectRef.h:79
JSObjectRef JSObjectMakeDeferredPromise(JSContextRef ctx, JSObjectRef *resolve, JSObjectRef *reject, JSValueRef *exception) JSC_API_AVAILABLE(macos(10.15)
Creates a JavaScript promise object by invoking the provided executor.
void(*) JSObjectInitializeCallbackEx(JSContextRef ctx, JSClassRef jsClass, JSObjectRef object)
Definition JSObjectRef.h:98
bool JSObjectSetPrivate(JSObjectRef object, void *data)
Sets a pointer to private data on an object.
JSObjectRef JSObjectMakeError(JSContextRef ctx, size_t argumentCount, const JSValueRef arguments[], JSValueRef *exception) JSC_API_AVAILABLE(macos(10.6)
Creates a JavaScript Error object, as if by invoking the built-in Error constructor.
@ kJSPropertyAttributeReadOnly
Definition JSObjectRef.h:54
@ kJSPropertyAttributeNone
Definition JSObjectRef.h:53
@ kJSPropertyAttributeDontDelete
Definition JSObjectRef.h:56
@ kJSPropertyAttributeDontEnum
Definition JSObjectRef.h:55
bool JSObjectSetPropertiesUTF8(JSContextRef ctx, JSObjectRef object, const char *const *names, const JSValueRef *values, size_t count, unsigned attributes, JSValueRef *exception)
Sets multiple properties of an object in one call, using UTF-8 property names.
bool(*) JSObjectSetPropertyCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef *exception)
The callback invoked when setting a property's value.
Definition JSObjectRef.h:183
JSValueRef(*) JSObjectConvertToTypeCallback(JSContextRef ctx, JSObjectRef object, JSType type, JSValueRef *exception)
The callback invoked when converting an object to a particular JavaScript type.
Definition JSObjectRef.h:350
JSClassRef JSClassRetain(JSClassRef jsClass)
Retains a JavaScript class.
bool JSObjectHasProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName)
Tests whether an object has a given property.
bool JSObjectFreeze(JSContextRef ctx, JSObjectRef object, JSValueRef *exception)
Freezes an object, equivalent to Object.freeze.
JSObjectRef JSObjectMakeDate(JSContextRef ctx, size_t argumentCount, const JSValueRef arguments[], JSValueRef *exception) JSC_API_AVAILABLE(macos(10.6)
Creates a JavaScript Date object, as if by invoking the built-in Date constructor.
JSObjectRef JSObjectMakeFunctionWithCallback(JSContextRef ctx, JSStringRef name, JSObjectCallAsFunctionCallback callAsFunction)
Convenience method for creating a JavaScript function with a given callback as its implementation.
JSObjectRef JSObjectMakeTypedError(JSContextRef ctx, JSTypedErrorType type, JSStringRef message)
Creates a JavaScript error object of a given type.
bool(*) JSObjectSetPropertyCallbackEx(JSContextRef ctx, JSClassRef jsClass, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef *exception)
Definition JSObjectRef.h:187
enum JSTypedArrayType ios
JSType
A constant identifying the type of a JSValue.
Definition JSValueRef.h:48
JSTypedErrorType
A constant identifying the type of a JavaScript error object.
Definition JSValueRef.h:392
#define JSC_API_AVAILABLE(...)
Definition WebKitAvailability.h:46
JSObjectInitializeCallback initialize
JSObjectHasPropertyCallback hasProperty
JSObjectDeletePropertyCallback deleteProperty
JSObjectHasInstanceCallback hasInstance
JSObjectGetPropertyCallback getProperty
JSObjectGetPropertyNamesCallback getPropertyNames
JSObjectConvertToTypeCallback convertToType
JSObjectCallAsFunctionCallback callAsFunction
JSObjectSetPropertyCallback setProperty
const JSStaticValue * staticValues
JSObjectCallAsConstructorCallback callAsConstructor
JSObjectFinalizeCallback finalize
const JSStaticFunction * staticFunctions
JSObjectDeletePropertyCallbackEx deletePropertyEx
JSObjectHasPropertyCallbackEx hasPropertyEx
JSObjectConvertToTypeCallbackEx convertToTypeEx
const JSStaticValueEx * staticValuesEx
JSObjectCallAsConstructorCallbackEx callAsConstructorEx
const JSStaticFunctionEx * staticFunctionsEx
JSObjectGetPropertyCallbackEx getPropertyEx
JSObjectInitializeCallbackEx initializeEx
JSObjectSetPropertyCallbackEx setPropertyEx
JSObjectFinalizeCallbackEx finalizeEx
JSObjectHasInstanceCallbackEx hasInstanceEx
JSObjectGetPropertyNamesCallbackEx getPropertyNamesEx
JSObjectCallAsFunctionCallbackEx callAsFunctionEx
This structure contains properties and callbacks that define a type of object. All fields other than ...
Definition JSObjectRef.h:483
JSClassAttributes attributes
Definition JSObjectRef.h:485
const char * className
Definition JSObjectRef.h:487
int version
Definition JSObjectRef.h:484
void * privateData
Definition JSObjectRef.h:526
JSClassRef parentClass
Definition JSObjectRef.h:488
Definition JSObjectRef.h:393
const char * name
Definition JSObjectRef.h:394
JSPropertyAttributes attributes
Definition JSObjectRef.h:396
JSObjectCallAsFunctionCallbackEx callAsFunctionEx
Definition JSObjectRef.h:395
This structure describes a statically declared function property.
Definition JSObjectRef.h:386
const char * name
Definition JSObjectRef.h:387
JSObjectCallAsFunctionCallback callAsFunction
Definition JSObjectRef.h:388
JSPropertyAttributes attributes
Definition JSObjectRef.h:389
Definition JSObjectRef.h:372
JSObjectGetPropertyCallbackEx getPropertyEx
Definition JSObjectRef.h:374
JSObjectSetPropertyCallbackEx setPropertyEx
Definition JSObjectRef.h:375
const char * name
Definition JSObjectRef.h:373
JSPropertyAttributes attributes
Definition JSObjectRef.h:376
This structure describes a statically declared value property.
Definition JSObjectRef.h:364
JSObjectGetPropertyCallback getProperty
Definition JSObjectRef.h:366
const char * name
Definition JSObjectRef.h:365
JSObjectSetPropertyCallback setProperty
Definition JSObjectRef.h:367
JSPropertyAttributes attributes
Definition JSObjectRef.h:368