NS_RELEASE(secMan);
GetHTMLSelectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp){  nsIDOMHTMLSelectElement *a = (nsIDOMHTMLSelectElement*)nsJSUtils::nsGetNativeThis(cx, obj);  // If there's no private data, this must be the prototype, so ignore  if (nsnull == a) {    return JS_TRUE;  }  if (JSVAL_IS_INT(id)) {    nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);    nsIScriptSecurityManager *secMan;    PRBool ok = PR_FALSE;    if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {      return JS_FALSE;    }    switch(JSVAL_TO_INT(id)) {      case HTMLSELECTELEMENT_TYPE:      {        secMan->CheckScriptAccess(scriptCX, obj, "htmlselectelement.type", &ok);        if (!ok) {          //Need to throw error here          return JS_FALSE;        }        nsAutoString prop;        if (NS_OK == a->GetType(prop)) {          nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);        }        else {          return JS_FALSE;        }        break;      }      case HTMLSELECTELEMENT_SELECTEDINDEX:      {        secMan->CheckScriptAccess(scriptCX, obj, "htmlselectelement.selectedindex", &ok);        if (!ok) {          //Need to throw error here          return JS_FALSE;        }        PRInt32 prop;        if (NS_OK == a->GetSelectedIndex(&prop)) {          *vp = INT_TO_JSVAL(prop);        }        else {          return JS_FALSE;        }        break;      }      case HTMLSELECTELEMENT_VALUE:      {        secMan->CheckScriptAccess(scriptCX, obj, "htmlselectelement.value", &ok);        if (!ok) {          //Need to throw error here          return JS_FALSE;        }        nsAutoString prop;        if (NS_OK == a->GetValue(prop)) {          nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);        }        else {          return JS_FALSE;        }        break;      }      case HTMLSELECTELEMENT_LENGTH:      {        secMan->CheckScriptAccess(scriptCX, obj, "htmlselectelement.length", &ok);        if (!ok) {          //Need to throw error here          return JS_FALSE;        }        PRUint32 prop;        if (NS_OK == a->GetLength(&prop)) {          *vp = INT_TO_JSVAL(prop);        }        else {          return JS_FALSE;        }        break;      }      case HTMLSELECTELEMENT_FORM:      {        secMan->CheckScriptAccess(scriptCX, obj, "htmlselectelement.form", &ok);        if (!ok) {          //Need to throw error here          return JS_FALSE;        }        nsIDOMHTMLFormElement* prop;        if (NS_OK == a->GetForm(&prop)) {          // get the js object          nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);        }        else {          return JS_FALSE;        }        break;      }      case HTMLSELECTELEMENT_OPTIONS:      {        secMan->CheckScriptAccess(scriptCX, obj, "htmlselectelement.options", &ok);        if (!ok) {          //Need to throw error here          return JS_FALSE;        }        nsIDOMHTMLCollection* prop;        if (NS_OK == a->GetOptions(&prop)) {          // get the js object          nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);        }        else {          return JS_FALSE;        }        break;      }      case HTMLSELECTELEMENT_DISABLED:      {        secMan->CheckScriptAccess(scriptCX, obj, "htmlselectelement.disabled", &ok);        if (!ok) {          //Need to throw error here          return JS_FALSE;        }        PRBool prop;        if (NS_OK == a->GetDisabled(&prop)) {          *vp = BOOLEAN_TO_JSVAL(prop);        }        else {          return JS_FALSE;        }        break;      }      case HTMLSELECTELEMENT_MULTIPLE:      {        secMan->CheckScriptAccess(scriptCX, obj, "htmlselectelement.multiple", &ok);        if (!ok) {          //Need to throw error here          return JS_FALSE;        }        PRBool prop;        if (NS_OK == a->GetMultiple(&prop)) {          *vp = BOOLEAN_TO_JSVAL(prop);        }        else {          return JS_FALSE;        }        break;      }      case HTMLSELECTELEMENT_NAME:      {        secMan->CheckScriptAccess(scriptCX, obj, "htmlselectelement.name", &ok);        if (!ok) {          //Need to throw error here          return JS_FALSE;        }        nsAutoString prop;        if (NS_OK == a->GetName(prop)) {          nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);        }        else {          return JS_FALSE;        }        break;      }      case HTMLSELECTELEMENT_SIZE:      {        secMan->CheckScriptAccess(scriptCX, obj, "htmlselectelement.size", &ok);        if (!ok) {          //Need to throw error here          return JS_FALSE;        }        PRInt32 prop;        if (NS_OK == a->GetSize(&prop)) {          *vp = INT_TO_JSVAL(prop);        }        else {          return JS_FALSE;        }        break;      }      case HTMLSELECTELEMENT_TABINDEX:      {        secMan->CheckScriptAccess(scriptCX, obj, "htmlselectelement.tabindex", &ok);        if (!ok) {          //Need to throw error here          return JS_FALSE;        }        PRInt32 prop;        if (NS_OK == a->GetTabIndex(&prop)) {          *vp = INT_TO_JSVAL(prop);        }        else {          return JS_FALSE;        }        break;      }      default:        return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);    }    NS_RELEASE(secMan);  }  else {    return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);  }  return PR_TRUE;}