Added script namespace management mechanism. This allows external native code to add symbols and constructors to the script global namespace. Added IID() static method generation to IDL generator.
This commit is contained in:
@@ -99,7 +99,7 @@ GetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
|
||||
nsIDOMHTMLCollection* prop;
|
||||
if (NS_OK == a->GetCells(&prop)) {
|
||||
// get the js object
|
||||
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
|
||||
nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
@@ -110,7 +110,7 @@ GetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
|
||||
{
|
||||
nsAutoString prop;
|
||||
if (NS_OK == a->GetAlign(prop)) {
|
||||
nsConvertStringToJSVal(prop, cx, vp);
|
||||
nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
@@ -121,7 +121,7 @@ GetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
|
||||
{
|
||||
nsAutoString prop;
|
||||
if (NS_OK == a->GetBgColor(prop)) {
|
||||
nsConvertStringToJSVal(prop, cx, vp);
|
||||
nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
@@ -132,7 +132,7 @@ GetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
|
||||
{
|
||||
nsAutoString prop;
|
||||
if (NS_OK == a->GetCh(prop)) {
|
||||
nsConvertStringToJSVal(prop, cx, vp);
|
||||
nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
@@ -143,7 +143,7 @@ GetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
|
||||
{
|
||||
nsAutoString prop;
|
||||
if (NS_OK == a->GetChOff(prop)) {
|
||||
nsConvertStringToJSVal(prop, cx, vp);
|
||||
nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
@@ -154,7 +154,7 @@ GetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
|
||||
{
|
||||
nsAutoString prop;
|
||||
if (NS_OK == a->GetVAlign(prop)) {
|
||||
nsConvertStringToJSVal(prop, cx, vp);
|
||||
nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
@@ -162,11 +162,11 @@ GetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
|
||||
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
|
||||
}
|
||||
}
|
||||
else {
|
||||
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
|
||||
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
|
||||
}
|
||||
|
||||
return PR_TRUE;
|
||||
@@ -223,7 +223,7 @@ SetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
|
||||
case HTMLTABLEROWELEMENT_CELLS:
|
||||
{
|
||||
nsIDOMHTMLCollection* prop;
|
||||
if (PR_FALSE == nsConvertJSValToObject((nsISupports **)&prop,
|
||||
if (PR_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&prop,
|
||||
kIHTMLCollectionIID, "HTMLCollection",
|
||||
cx, *vp)) {
|
||||
return JS_FALSE;
|
||||
@@ -236,7 +236,7 @@ SetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
|
||||
case HTMLTABLEROWELEMENT_ALIGN:
|
||||
{
|
||||
nsAutoString prop;
|
||||
nsConvertJSValToString(prop, cx, *vp);
|
||||
nsJSUtils::nsConvertJSValToString(prop, cx, *vp);
|
||||
|
||||
a->SetAlign(prop);
|
||||
|
||||
@@ -245,7 +245,7 @@ SetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
|
||||
case HTMLTABLEROWELEMENT_BGCOLOR:
|
||||
{
|
||||
nsAutoString prop;
|
||||
nsConvertJSValToString(prop, cx, *vp);
|
||||
nsJSUtils::nsConvertJSValToString(prop, cx, *vp);
|
||||
|
||||
a->SetBgColor(prop);
|
||||
|
||||
@@ -254,7 +254,7 @@ SetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
|
||||
case HTMLTABLEROWELEMENT_CH:
|
||||
{
|
||||
nsAutoString prop;
|
||||
nsConvertJSValToString(prop, cx, *vp);
|
||||
nsJSUtils::nsConvertJSValToString(prop, cx, *vp);
|
||||
|
||||
a->SetCh(prop);
|
||||
|
||||
@@ -263,7 +263,7 @@ SetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
|
||||
case HTMLTABLEROWELEMENT_CHOFF:
|
||||
{
|
||||
nsAutoString prop;
|
||||
nsConvertJSValToString(prop, cx, *vp);
|
||||
nsJSUtils::nsConvertJSValToString(prop, cx, *vp);
|
||||
|
||||
a->SetChOff(prop);
|
||||
|
||||
@@ -272,18 +272,18 @@ SetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
|
||||
case HTMLTABLEROWELEMENT_VALIGN:
|
||||
{
|
||||
nsAutoString prop;
|
||||
nsConvertJSValToString(prop, cx, *vp);
|
||||
nsJSUtils::nsConvertJSValToString(prop, cx, *vp);
|
||||
|
||||
a->SetVAlign(prop);
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
|
||||
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
|
||||
}
|
||||
}
|
||||
else {
|
||||
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
|
||||
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
|
||||
}
|
||||
|
||||
return PR_TRUE;
|
||||
@@ -296,7 +296,7 @@ SetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
|
||||
PR_STATIC_CALLBACK(void)
|
||||
FinalizeHTMLTableRowElement(JSContext *cx, JSObject *obj)
|
||||
{
|
||||
nsGenericFinalize(cx, obj);
|
||||
nsJSUtils::nsGenericFinalize(cx, obj);
|
||||
}
|
||||
|
||||
|
||||
@@ -306,7 +306,7 @@ FinalizeHTMLTableRowElement(JSContext *cx, JSObject *obj)
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
EnumerateHTMLTableRowElement(JSContext *cx, JSObject *obj)
|
||||
{
|
||||
return nsGenericEnumerate(cx, obj);
|
||||
return nsJSUtils::nsGenericEnumerate(cx, obj);
|
||||
}
|
||||
|
||||
|
||||
@@ -316,7 +316,7 @@ EnumerateHTMLTableRowElement(JSContext *cx, JSObject *obj)
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
ResolveHTMLTableRowElement(JSContext *cx, JSObject *obj, jsval id)
|
||||
{
|
||||
return nsGenericResolve(cx, obj, id);
|
||||
return nsJSUtils::nsGenericResolve(cx, obj, id);
|
||||
}
|
||||
|
||||
|
||||
@@ -349,7 +349,7 @@ HTMLTableRowElementInsertCell(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function insertCell requires 1 parameters");
|
||||
|
||||
Reference in New Issue
Block a user