nsString ustr; ustr.AssignWithConversion(str);
nsAutoString ustr; ustr.AssignWithConversion(str);
nsFormControlList::GetNamedObject(JSContext* aContext, jsval aID, JSObject** aObj) {  NS_ENSURE_ARG_POINTER(aObj);  *aObj = nsnull;  if (!mForm) {    // No form, no named objects    return NS_OK;  }    nsresult rv = NS_OK;  nsCOMPtr<nsIScriptContext> scriptContext;  nsCOMPtr<nsIScriptObjectOwner> owner;  char* str = JS_GetStringBytes(JS_ValueToString(aContext, aID));  if (mLookupTable) {    // Get the hash entry    nsString ustr; ustr.AssignWithConversion(str);    nsStringKey key(ustr);    nsCOMPtr<nsISupports> tmp = dont_AddRef((nsISupports *)mLookupTable->Get(&key));    if (tmp) {      // Found something, we don't care here if it's a element or a node      // list, we just return the script object      owner = do_QueryInterface(tmp);    }  }  if (!owner) {    // No owner means we didn't find anything, at least not something we can    // return as a JSObject.    return NS_OK;  }  nsCOMPtr<nsIDocument> document;  nsCOMPtr<nsIContent> form = do_QueryInterface(mForm);  if (form) {    rv = form->GetDocument(*getter_AddRefs(document));    if (NS_FAILED(rv)) {      return rv;    }  }  if (document) {    nsCOMPtr<nsIScriptGlobalObject> globalObject;    document->GetScriptGlobalObject(getter_AddRefs(globalObject));    if (globalObject) {      rv = globalObject->GetContext(getter_AddRefs(scriptContext));    }  }  // If we can't get a script context, there's nothing we can do  if (!scriptContext) {    return NS_ERROR_FAILURE;  }  return owner->GetScriptObject(scriptContext, (void**)aObj);}