JS_PSGS

This article needs a technical review. How you can help.

This article covers features introduced in SpiderMonkey 17

Macros for describing properties, for use with JS_DefineProperties and JS_InitClass.

Syntax

#define JS_PSG(name, getter, flags) ...
#define JS_PSGS(name, getter, setter, flags) ...
#define JS_SELF_HOSTED_GET(name, getterName, flags) ... // Added in SpiderMonkey 31
#define JS_SELF_HOSTED_GETSET(name, getterName, setterName, flags) ... // Added in SpiderMonkey 31

#define JS_PS_END ...
Name Type Description
name const char * The JavaScript name for the property. (or index, if JSPROP_INDEX is present in flags)
getter JSNative Pointer to the C/C++ implementation of the getter function.
setter JSNative Pointer to the C/C++ implementation of the setter function.
flags uint16 The bitwise OR of any number of property attributes.
getterName const char * The function's name in Self-Hosted JavaScript code for getter function.
setterName const char * The function's name in Self-Hosted JavaScript code for setter function.

Description

These macros encapsulate the definition of JSNative-backed JSPropertySpecs, by defining the JSNativeWrappers for them.

See Also

Document Tags and Contributors

 Contributors to this page: pipcet, kscarfone, arai
 Last updated by: pipcet,