result = textContent->SetText(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsstr)), JS_GetStringLength(jsstr), PR_FALSE);  if (NS_FAILED(result)) { return result; }
textContent->SetText(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsstr)), JS_GetStringLength(jsstr), PR_FALSE);
nsHTMLOptionElement::Initialize(JSContext* aContext,                                 JSObject *aObj,                                PRUint32 argc,                                 jsval *argv){  nsresult result = NS_OK;  if (argc > 0) {    // The first (optional) parameter is the text of the option    JSString* jsstr = JS_ValueToString(aContext, argv[0]);    if (jsstr) {      // Create a new text node and append it to the option      nsCOMPtr<nsITextContent> textContent;      result = NS_NewTextNode(getter_AddRefs(textContent));      if (NS_FAILED(result)) {        return result;      }      result =        textContent->SetText(NS_REINTERPRET_CAST(const PRUnichar*,                                                 JS_GetStringChars(jsstr)),                             JS_GetStringLength(jsstr),                             PR_FALSE);      if (NS_FAILED(result)) {        return result;      }            result = AppendChildTo(textContent, PR_FALSE, PR_FALSE);      if (NS_FAILED(result)) {        return result;      }    }    if (argc > 1) {      // The second (optional) parameter is the value of the option      jsstr = JS_ValueToString(aContext, argv[1]);      if (nsnull != jsstr) {        // Set the value attribute for this element        nsAutoString value(NS_REINTERPRET_CAST(const PRUnichar*,                                               JS_GetStringChars(jsstr)));        result = SetAttr(kNameSpaceID_None, nsHTMLAtoms::value, value,                         PR_FALSE);        if (NS_FAILED(result)) {          return result;        }      }      if (argc > 2) {        // The third (optional) parameter is the defaultSelected value        JSBool defaultSelected;        if ((JS_TRUE == JS_ValueToBoolean(aContext,                                          argv[2],                                          &defaultSelected)) &&            (JS_TRUE == defaultSelected)) {          result = SetAttr(kNameSpaceID_None, nsHTMLAtoms::selected,                           EmptyString(), PR_FALSE);          NS_ENSURE_SUCCESS(result, result);        }        // XXX This is *untested* behavior.  Should work though.        if (argc > 3) {          JSBool selected;          if (JS_TRUE == JS_ValueToBoolean(aContext,                                           argv[3],                                           &selected)) {            return SetSelected(selected);          }        }      }    }  }  return result;}