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.
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:261
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:240
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:280
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.
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:130
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
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.
void(* JSObjectGetPropertyNamesCallback)(JSContextRef ctx, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames)
The callback invoked when collecting the names of an object's properties.
Definition JSObjectRef.h:199
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:182
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:110
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:165
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:147
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:220
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
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.
bool JSObjectHasProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName)
Tests whether an object has a given property.
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:46
This structure contains properties and callbacks that define a type of object. All fields other than ...
Definition JSObjectRef.h:345
JSObjectInitializeCallback initialize
Definition JSObjectRef.h:355
JSObjectHasPropertyCallback hasProperty
Definition JSObjectRef.h:357
JSObjectDeletePropertyCallback deleteProperty
Definition JSObjectRef.h:360
JSClassAttributes attributes
Definition JSObjectRef.h:347
const char * className
Definition JSObjectRef.h:349
JSObjectHasInstanceCallback hasInstance
Definition JSObjectRef.h:364
JSObjectGetPropertyCallback getProperty
Definition JSObjectRef.h:358
JSObjectGetPropertyNamesCallback getPropertyNames
Definition JSObjectRef.h:361
int version
Definition JSObjectRef.h:346
JSObjectConvertToTypeCallback convertToType
Definition JSObjectRef.h:365
JSObjectCallAsFunctionCallback callAsFunction
Definition JSObjectRef.h:362
JSObjectSetPropertyCallback setProperty
Definition JSObjectRef.h:359
const JSStaticValue * staticValues
Definition JSObjectRef.h:352
JSObjectCallAsConstructorCallback callAsConstructor
Definition JSObjectRef.h:363
JSObjectFinalizeCallback finalize
Definition JSObjectRef.h:356
const JSStaticFunction * staticFunctions
Definition JSObjectRef.h:353
JSClassRef parentClass
Definition JSObjectRef.h:350
This structure describes a statically declared function property.
Definition JSObjectRef.h:304
const char * name
Definition JSObjectRef.h:305
JSObjectCallAsFunctionCallback callAsFunction
Definition JSObjectRef.h:306
JSPropertyAttributes attributes
Definition JSObjectRef.h:307
This structure describes a statically declared value property.
Definition JSObjectRef.h:290
JSObjectGetPropertyCallback getProperty
Definition JSObjectRef.h:292
const char * name
Definition JSObjectRef.h:291
JSObjectSetPropertyCallback setProperty
Definition JSObjectRef.h:293
JSPropertyAttributes attributes
Definition JSObjectRef.h:294