nsAutoString value(JS_GetStringChars(jsstr));
nsAutoString value(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsstr)));
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 (nsnull != jsstr) {      // Create a new text node and append it to the option      nsCOMPtr<nsIContent> textNode;      nsITextContent* content;      result = NS_NewTextNode(getter_AddRefs(textNode));      if (NS_FAILED(result)) {        return result;      }            result = textNode->QueryInterface(kITextContentIID, (void**)&content);      if (NS_FAILED(result)) {        return result;      }      result = content->SetText(JS_GetStringChars(jsstr),                                JS_GetStringLength(jsstr),                                PR_FALSE);      NS_RELEASE(content);      if (NS_FAILED(result)) {        return result;      }            // this addrefs textNode:      result = mInner.AppendChildTo(textNode, 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(JS_GetStringChars(jsstr));        result = mInner.SetAttribute(kNameSpaceID_HTML,                                     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)) {          nsHTMLValue empty(eHTMLUnit_Empty);          result = mInner.SetHTMLAttribute(nsHTMLAtoms::selected,                                            empty,                                            PR_FALSE);          if (NS_FAILED(result)) {            return result;          }                  }        // XXX Since we don't store the selected state, we can't deal        // with the fourth (optional) parameter that is meant to specify        // whether the option element should be currently selected or        // not. Does anyone depend on this behavior?      }    }  }  return result;}