This feature is obsolete. Although it is still supported by browsers, its usage is discouraged in new projects. Try to avoid using it.
Retrieves the class associated with an object.
#ifdef JS_THREADSAFE #define JS_GET_CLASS(cx, obj) ... #else #define JS_GET_CLASS(cx, obj) ... #endif
| || ||Any context associated with the runtime in which |
| || ||Object to get the class from.|
JS_GetClasstook both a
JSObject*as arguments in thread-safe builds, and in non-thread-safe builds it took only a
JSObject*. The JS_GET_CLASS(cx, obj)macro abstracted away this detail. Newer versions have removed the context argument, so that the same signature is used regardless whether or not the build is thread-safe.
JS_GET_CLASS returns a pointer to the
JSClass associated with a specified JS object,
obj. The application must treat the
JSClass as read-only.
JS_GET_CLASS abstracted away signature differences in the
JS_GetClass method in threadsafe and non-threadsafe builds. As of SpiderMonkey 1.8.8 it no longer exists, because JS_GetClass's signature is the same in all build environments.