gClassTable->Put(&key, (void*)c);
(nsXBLService::gClassTable)->Put(&key, (void*)c);
nsXBLBinding::InitClass(const nsCString& aClassName, nsIScriptContext* aContext,                         nsIDocument* aDocument, void** aScriptObject, void** aClassObject){  *aClassObject = nsnull;  *aScriptObject = nsnull;  // Obtain the bound element's current script object.  nsCOMPtr<nsIScriptObjectOwner> owner(do_QueryInterface(mBoundElement));  owner->GetScriptObject(aContext, aScriptObject);  if (!(*aScriptObject))    return NS_ERROR_FAILURE;  JSObject* object = (JSObject*)(*aScriptObject);  // First ensure our JS class is initialized.  JSContext* jscontext = (JSContext*)aContext->GetNativeContext();  JSObject* proto = nsnull;  JSObject* constructor = nsnull;  JSObject* parent_proto = nsnull;  JSObject* global = JS_GetGlobalObject(jscontext);  jsval vp;  if ((PR_TRUE != JS_LookupProperty(jscontext, global, aClassName, &vp)) ||      !JSVAL_IS_OBJECT(vp) ||      ((constructor = JSVAL_TO_OBJECT(vp)) == nsnull) ||      (PR_TRUE != JS_LookupProperty(jscontext, JSVAL_TO_OBJECT(vp), "prototype", &vp)) ||       !JSVAL_IS_OBJECT(vp)) {    // We need to initialize the class.        JSClass* c;    void* classObject;    nsStringKey key(aClassName);    classObject = gClassTable->Get(&key);    if (classObject)      c = (JSClass*)classObject;    else {      // We need to create a struct for this class.      c = new JSClass;      c->name = nsXPIDLCString::Copy(aClassName);      c->flags = JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS;      c->addProperty = c->delProperty = c->setProperty = c->getProperty = JS_PropertyStub;      c->enumerate = JS_EnumerateStub;      c->resolve = JS_ResolveStub;      c->convert = JS_ConvertStub;      c->finalize = XBLFinalize;      c->getObjectOps = 0;      c->checkAccess = 0;      c->call = 0;      c->construct = 0;      c->xdrObject = 0;      c->hasInstance = 0;      // Add c to our table.      gClassTable->Put(&key, (void*)c);    }        // Retrieve the current prototype for the JS object.    parent_proto = JS_GetPrototype(jscontext, object);    proto = JS_InitClass(jscontext,     // context                         global,        // global object                         parent_proto,  // parent proto                          c,      // JSClass                         XBLBindingCtor,            // JSNative ctor                         0,             // ctor args                         nsnull,  // proto props                         nsnull,     // proto funcs                         nsnull,        // ctor props (static)                         nsnull);       // ctor funcs (static)    if (nsnull == proto) {      return NS_ERROR_FAILURE;    }    *aClassObject = (void*)proto;  }  else if ((nsnull != constructor) && JSVAL_IS_OBJECT(vp)) {    proto = JSVAL_TO_OBJECT(vp);  }  else {    return NS_ERROR_FAILURE;  }  // Set the prototype of our object to be the new class.  JS_SetPrototype(jscontext, object, proto);  return NS_OK;}