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.
@ kJSPropertyAttributeReadOnly
Definition JSObjectRef.h:52
@ kJSPropertyAttributeNone
Definition JSObjectRef.h:51
@ kJSPropertyAttributeDontDelete
Definition JSObjectRef.h:54
@ kJSPropertyAttributeDontEnum
Definition JSObjectRef.h:53
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(* JSObjectHasPropertyCallbackEx)(JSContextRef ctx, JSClassRef jsClass, JSObjectRef object, JSStringRef propertyName)
Definition JSObjectRef.h:142
bool(* JSObjectDeletePropertyCallbackEx)(JSContextRef ctx, JSClassRef jsClass, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception)
Definition JSObjectRef.h:206
bool JSClassSetPrivate(JSClassRef jsClass, void *data)
Sets the private data on a class, only possible with classes created with version 1000 (extended call...
bool(* JSObjectSetPropertyCallbackEx)(JSContextRef ctx, JSClassRef jsClass, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef *exception)
Definition JSObjectRef.h:185
JSValueRef JSObjectGetPrototype(JSContextRef ctx, JSObjectRef object)
Gets an object's prototype.
void JSPropertyNameArrayRelease(JSPropertyNameArrayRef array)
Releases a JavaScript property name array.
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:299
void * JSClassGetPrivate(JSClassRef jsClass)
Retrieves the private data from a class reference, only possible with classes created with version 10...
void(* JSObjectFinalizeCallbackEx)(JSClassRef jsClass, JSObjectRef object)
Definition JSObjectRef.h:118
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:274
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.
JSValueRef JSObjectCallAsFunction(JSContextRef ctx, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef *exception)
Calls an object as a function.
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:322
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.
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:163
void JSObjectSetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSPropertyAttributes attributes, JSValueRef *exception)
Sets a property on an object.
void(* JSObjectInitializeCallback)(JSContextRef ctx, JSObjectRef object)
The callback invoked when an object is first created.
Definition JSObjectRef.h:92
bool(* JSObjectHasPropertyCallback)(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName)
The callback invoked when determining whether an object has a property.
Definition JSObjectRef.h:138
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.
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:61
JSObjectRef(* JSObjectCallAsConstructorCallbackEx)(JSContextRef ctx, JSClassRef jsClass, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef *exception)
Definition JSObjectRef.h:278
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.
JSValueRef(* JSObjectConvertToTypeCallbackEx)(JSContextRef ctx, JSClassRef jsClass, JSObjectRef object, JSType type, JSValueRef *exception)
Definition JSObjectRef.h:326
void(* JSObjectGetPropertyNamesCallback)(JSContextRef ctx, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames)
The callback invoked when collecting the names of an object's properties.
Definition JSObjectRef.h:223
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.
bool(* JSObjectDeletePropertyCallback)(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception)
The callback invoked when deleting a property.
Definition JSObjectRef.h:202
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 JSObjectIsConstructor(JSContextRef ctx, JSObjectRef object)
Tests whether an object can be called as a constructor.
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.
bool JSObjectDeleteProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception)
Deletes a property from an object.
void JSObjectSetPrototype(JSContextRef ctx, JSObjectRef object, JSValueRef value)
Sets an object's prototype.
void(* JSObjectFinalizeCallback)(JSObjectRef object)
The callback invoked when an object is finalized (prepared for garbage collection)....
Definition JSObjectRef.h:114
JSObjectRef JSObjectCallAsConstructor(JSContextRef ctx, JSObjectRef object, size_t argumentCount, const JSValueRef arguments[], JSValueRef *exception)
Calls an object as a constructor.
bool(* JSObjectSetPropertyCallback)(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef *exception)
The callback invoked when setting a property's value.
Definition JSObjectRef.h:181
bool JSObjectIsFunction(JSContextRef ctx, JSObjectRef object)
Tests whether an object can be called as a function.
JSValueRef(* JSObjectGetPropertyCallback)(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception)
The callback invoked when getting a property's value.
Definition JSObjectRef.h:159
void(* JSObjectGetPropertyNamesCallbackEx)(JSContextRef ctx, JSClassRef jsClass, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames)
Definition JSObjectRef.h:227
JSPropertyNameArrayRef JSObjectCopyPropertyNames(JSContextRef ctx, JSObjectRef object)
Gets the names of an object's enumerable properties.
JSValueRef JSObjectGetPropertyAtIndex(JSContextRef ctx, JSObjectRef object, unsigned propertyIndex, JSValueRef *exception)
Gets a property from an object by numeric index.
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:248
unsigned JSClassAttributes
A set of JSClassAttributes. Combine multiple attributes by logically ORing them together.
Definition JSObjectRef.h:77
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.
@ kJSClassAttributeNone
Definition JSObjectRef.h:69
@ kJSClassAttributeNoAutomaticPrototype
Definition JSObjectRef.h:70
void(* JSObjectInitializeCallbackEx)(JSContextRef ctx, JSClassRef jsClass, JSObjectRef object)
Definition JSObjectRef.h:96
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.
JSClassRef JSClassRetain(JSClassRef jsClass)
Retains a JavaScript class.
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 JSObjectHasProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName)
Tests whether an object has a given property.
bool(* JSObjectHasInstanceCallbackEx)(JSContextRef ctx, JSClassRef jsClass, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef *exception)
Definition JSObjectRef.h:303
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.
JSType
A constant identifying the type of a JSValue.
Definition JSValueRef.h:47
#define JSC_API_AVAILABLE(...)
Definition WebKitAvailability.h:77
This structure contains properties and callbacks that define a type of object. All fields other than ...
Definition JSObjectRef.h:404
const JSStaticValue * staticValues
Definition JSObjectRef.h:414
JSObjectDeletePropertyCallback deleteProperty
Definition JSObjectRef.h:421
JSObjectDeletePropertyCallbackEx deletePropertyEx
Definition JSObjectRef.h:438
JSObjectSetPropertyCallback setProperty
Definition JSObjectRef.h:420
JSObjectCallAsFunctionCallbackEx callAsFunctionEx
Definition JSObjectRef.h:440
JSObjectHasPropertyCallbackEx hasPropertyEx
Definition JSObjectRef.h:435
JSObjectFinalizeCallbackEx finalizeEx
Definition JSObjectRef.h:434
JSObjectCallAsFunctionCallback callAsFunction
Definition JSObjectRef.h:423
JSObjectInitializeCallbackEx initializeEx
Definition JSObjectRef.h:433
JSObjectHasInstanceCallback hasInstance
Definition JSObjectRef.h:425
int version
Definition JSObjectRef.h:405
const JSStaticFunction * staticFunctions
Definition JSObjectRef.h:415
JSObjectHasPropertyCallback hasProperty
Definition JSObjectRef.h:418
JSObjectConvertToTypeCallbackEx convertToTypeEx
Definition JSObjectRef.h:443
JSObjectGetPropertyNamesCallbackEx getPropertyNamesEx
Definition JSObjectRef.h:439
JSObjectCallAsConstructorCallback callAsConstructor
Definition JSObjectRef.h:424
JSObjectInitializeCallback initialize
Definition JSObjectRef.h:416
JSClassRef parentClass
Definition JSObjectRef.h:409
JSObjectSetPropertyCallbackEx setPropertyEx
Definition JSObjectRef.h:437
JSObjectCallAsConstructorCallbackEx callAsConstructorEx
Definition JSObjectRef.h:441
JSObjectFinalizeCallback finalize
Definition JSObjectRef.h:417
const JSStaticValueEx * staticValuesEx
Definition JSObjectRef.h:431
JSClassAttributes attributes
Definition JSObjectRef.h:406
JSObjectHasInstanceCallbackEx hasInstanceEx
Definition JSObjectRef.h:442
JSObjectGetPropertyCallbackEx getPropertyEx
Definition JSObjectRef.h:436
const JSStaticFunctionEx * staticFunctionsEx
Definition JSObjectRef.h:432
JSObjectGetPropertyNamesCallback getPropertyNames
Definition JSObjectRef.h:422
JSObjectConvertToTypeCallback convertToType
Definition JSObjectRef.h:426
const char * className
Definition JSObjectRef.h:408
void * privateData
Definition JSObjectRef.h:447
JSObjectGetPropertyCallback getProperty
Definition JSObjectRef.h:419
Definition JSObjectRef.h:365
const char * name
Definition JSObjectRef.h:366
JSObjectCallAsFunctionCallbackEx callAsFunctionEx
Definition JSObjectRef.h:367
JSPropertyAttributes attributes
Definition JSObjectRef.h:368
This structure describes a statically declared function property.
Definition JSObjectRef.h:358
JSPropertyAttributes attributes
Definition JSObjectRef.h:361
JSObjectCallAsFunctionCallback callAsFunction
Definition JSObjectRef.h:360
const char * name
Definition JSObjectRef.h:359
Definition JSObjectRef.h:344
JSObjectSetPropertyCallbackEx setPropertyEx
Definition JSObjectRef.h:347
JSObjectGetPropertyCallbackEx getPropertyEx
Definition JSObjectRef.h:346
JSPropertyAttributes attributes
Definition JSObjectRef.h:348
const char * name
Definition JSObjectRef.h:345
This structure describes a statically declared value property.
Definition JSObjectRef.h:336
JSObjectSetPropertyCallback setProperty
Definition JSObjectRef.h:339
const char * name
Definition JSObjectRef.h:337
JSPropertyAttributes attributes
Definition JSObjectRef.h:340
JSObjectGetPropertyCallback getProperty
Definition JSObjectRef.h:338