Add native methods to an object.
JSBool JS_DefineFunctions(JSContext *cx, JSObject *obj, const JSFunctionSpec *fs);
||The context in which to define functions. Requires request. In a
||The object on which functions are to be defined.|
JS_DefineFunctionswas not const.
JS_DefineFunctions creates zero or more functions and makes them properties (methods) of a specified object,
obj, as if by calling
fs is a pointer to the first element of an array of
JSFunctionSpec records. This array is usually defined as a static global, with each record initialized using
0 values. (The macro
JS_FS_END can be used for the last element.)
JS_DefineFunctions creates one function for each non-zero element in the array.
JS_TRUE. On error or exception, it stops defining functions and returns