char *JS_ObjectType()

Description

Given an object reference, the JS_ObjectType() function returns the class name of the object. For example, if the object is a DOM object, the function returns "Document". If the object is a node in the document, the function returns "Element". For an array object, the function returns "Array".

NOTE

Do not modify the returned buffer pointer or you might corrupt the data structures of the JavaScript interpreter.

Arguments

JSObject *obj

  • Typically, this argument is passed in and converted using the JS_ValueToObject() function.

Returns

A pointer to a null-terminated string. The caller should not free this string when it finishes.