Obsolete since JSAPI 26
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
Get the attributes of a specified property.
Syntax
JSBool
JS_GetPropertyAttributes(JSContext *cx, JSObject *obj,
    const char *name, unsigned int *attrsp, JSBool *foundp);
JSBool
JS_GetUCPropertyAttributes(JSContext *cx, JSObject *obj,
    const jschar *name, size_t namelen,
    unsigned int *attrsp, JSBool *foundp);
| Name | Type | Description | 
|---|---|---|
| cx | JSContext * | The context in which to look up property attributes. Requires request. In a JS_THREADSAFEbuild, the caller must be in a request on thisJSContext. | 
| obj | JSObject * | The object that has the property to be queried. | 
| name | const char *orconst  | Name of the property from which to retrieve attributes. | 
| namelen | size_t | (only in JS_GetUCPropertyAttributes) The length ofnamein characters; or(size_t) -1to indicate thatnameis null-terminated. | 
| attrsp | unsigned int * | Out parameter. If the specified property is found on obj,*attrspreceives its attributes. | 
| foundp | JSBool * | Out parameter. If no error occurs, *foundpreceivesJS_TRUEif the specified property is found andJS_FALSEif it is not found. If an error occurs, the value left in*foundpis unspecified. | 
Description
JS_GetPropertyAttributes retrieves the property attributes of the property with the given name on a given object, obj. JS_GetUCPropertyAttributes is the Unicode version of the function.
If an error occurs, the return value is JS_FALSE, and the values left in *attrsp and *foundp are unspecified.
If obj does not have the specified property, or if it inherits it from some other object (on its prototype chain, for example), then *foundp is set to JS_FALSE. The value left in *attrsp is unspecified. The return value is JS_TRUE (to indicate that no error occurred).
If the property exists and belongs to obj, then *foundp is set to JS_TRUE, *attrsp is set to the logical OR of zero or more Property attributes flags, and the function returns JS_TRUE.