rv = nsDOMGenericSH::WrapNative(cx, ::JS_GetGlobalObject(cx), native,
rv = nsDOMGenericSH::WrapNative(cx, GetGlobalJSObject(cx, obj), native,
BaseStubConstructor(const nsGlobalNameStruct *name_struct, JSContext *cx,                    JSObject *obj, uintN argc, jsval *argv, jsval *rval){  nsresult rv;  nsCOMPtr<nsISupports> native;  if (name_struct->mType == nsGlobalNameStruct::eTypeExternalConstructor) {    native = do_CreateInstance(name_struct->mCID, &rv);  } else if (name_struct->mType == nsGlobalNameStruct::eTypeExternalConstructorAlias) {    native = do_CreateInstance(name_struct->mAlias->mCID, &rv);  } else {    native = do_CreateInstance(*name_struct->mData->mConstructorCID, &rv);  }  if (NS_FAILED(rv)) {    NS_ERROR("Failed to create the object");    nsDOMClassInfo::ThrowJSException(cx, rv);    return JS_FALSE;  }  nsCOMPtr<nsIJSNativeInitializer> initializer(do_QueryInterface(native));  if (initializer) {    rv = initializer->Initialize(cx, obj, argc, argv);    if (NS_FAILED(rv)) {      nsDOMClassInfo::ThrowJSException(cx, NS_ERROR_NOT_INITIALIZED);      return JS_FALSE;    }  }  nsCOMPtr<nsIScriptObjectOwner> owner(do_QueryInterface(native));  if (owner) {    nsIScriptContext *context = nsJSUtils::GetStaticScriptContext(cx, obj);    if (!context) {      nsDOMClassInfo::ThrowJSException(cx, NS_ERROR_UNEXPECTED);      return JS_FALSE;    }    JSObject* new_obj;    rv = owner->GetScriptObject(context, (void**)&new_obj);    if (NS_SUCCEEDED(rv)) {      *rval = OBJECT_TO_JSVAL(new_obj);    }    return rv;  }  rv = nsDOMGenericSH::WrapNative(cx, ::JS_GetGlobalObject(cx), native,                                  NS_GET_IID(nsISupports), rval);  return NS_SUCCEEDED(rv) ? JS_TRUE : JS_FALSE;}