Esempio n. 1
0
JSBool JSJSGlobalObject::fromjs_shutdown(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) {
  // get instance
  JSGlobalObject *object = static_cast<JSGlobalObject *>(reinterpret_cast<JSScriptable *>(JS_GetPrivate(cx, obj)));
  if (!object) {
    JSScriptable::js_throwNullCallException(JSJSGlobalObject::classDescriptor.name, JSJSGlobalObject::functionTable[5].name);
    return JS_FALSE;
  }
  // record context
  object->js_setCurrentContext(cx);
  // call method
  ASSERT(object != NULL);
  object->shutdown();
  // success
  return JS_TRUE;
}