Added SetDocumentCharset.

git-svn-id: svn://10.0.0.236/trunk@22585 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
nhotta%netscape.com
1999-03-02 17:53:52 +00:00
parent 4e4a33af41
commit e99241e1d8

View File

@@ -179,6 +179,39 @@ BaseAppCoreInit(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
}
PR_STATIC_CALLBACK(JSBool)
BaseAppCoreSetDocumentCharset(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
nsIDOMBaseAppCore *nativeThis = (nsIDOMBaseAppCore*)JS_GetPrivate(cx, obj);
JSBool rBool = JS_FALSE;
nsAutoString b0;
*rval = JSVAL_NULL;
// If there's no private data, this must be the prototype, so ignore
if (nsnull == nativeThis) {
return JS_TRUE;
}
if (argc >= 1) {
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->SetDocumentCharset(b0)) {
return JS_FALSE;
}
*rval = JSVAL_VOID;
}
else {
JS_ReportError(cx, "Function close requires 0 parameters");
return JS_FALSE;
}
return JS_TRUE;
}
/***********************************************************************/
//
// class for BaseAppCore
@@ -213,6 +246,7 @@ static JSPropertySpec BaseAppCoreProperties[] =
static JSFunctionSpec BaseAppCoreMethods[] =
{
{"Init", BaseAppCoreInit, 1},
{"SetDocumentCharset", BaseAppCoreSetDocumentCharset, 1},
{0}
};