This article needs a technical review. How you can help.
This article covers features introduced in SpiderMonkey 45
bool JS_HasOwnProperty(JSContext* cx, HandleObject obj, const char* name, bool* foundp) bool JS_HasOwnPropertyById(JSContext* cx, HandleObject obj, HandleId id, bool* foundp)
||A context. Requires request. In a
||Object to search on for the property.|
||Name of the property to look up.|
||Non-null pointer to a variable of type
JS_HasOwnProperty searches an object,
obj, for an own property with the specified
JS_HasOwnPropertyById is the same but takes a
JS::HandleId for the property name.
If the property exists, this function sets
true and returns
If the object
obj has no such property, the function sets
false and returns
true (to indicate that no error occurred).
If an error occurs during the search, the function returns
false, and the value of
*foundp is undefined.