Type Alias

JSObjectGetPropertyNamesCallback

The callback invoked when collecting the names of an object’s properties.

Declaration

typedef void (*JSObjectGetPropertyNamesCallback)(JSContextRef ctx, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames);

Parameters

ctx

The execution context to use.

object

The JSObject whose property names are being collected.

accumulator

A JavaScript property name accumulator in which to accumulate the names of object's properties.

Discussion

If you named your function GetPropertyNames, you would declare it like this:

void GetPropertyNames(JSContextRef ctx, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames);

Property name accumulators are used by JSObjectCopyPropertyNames and JavaScript for...in loops.

Use JSPropertyNameAccumulatorAddName to add property names to accumulator. A class's getPropertyNames callback only needs to provide the names of properties that the class vends through a custom getProperty or setProperty callback. Other properties, including statically declared properties, properties vended by other classes, and properties belonging to object's prototype, are added independently.

See Also

Callbacks

JSObjectCallAsConstructorCallback

The callback invoked when an object is used as a constructor in a 'new' expression.

JSObjectCallAsFunctionCallback

The callback invoked when an object is called as a function.

JSObjectConvertToTypeCallback

The callback invoked when converting an object to a particular JavaScript type.

JSObjectDeletePropertyCallback

The callback invoked when deleting a property.

JSObjectFinalizeCallback

The callback invoked when an object is finalized (prepared for garbage collection). An object may be finalized on any thread.

JSObjectGetPropertyCallback

The callback invoked when getting a property’s value.

JSObjectHasInstanceCallback

hasInstance The callback invoked when an object is used as the target of an 'instanceof' expression.

JSObjectHasPropertyCallback

The callback invoked when determining whether an object has a property.

JSObjectInitializeCallback

The callback invoked when an object is first created.

JSObjectSetPropertyCallback

The callback invoked when setting a property’s value.