Modified JSStubGen to spit out correct code from XPConnect.

This commit is contained in:
waterson%netscape.com 1999-04-24 02:38:05 +00:00
parent 8b683492b5
commit e00ff30ebf

View File

@ -574,7 +574,11 @@ static const char *kObjectGetCaseStr =
static const char *kXPIDLObjectGetCaseStr =
" // get the js object\n"
" *vp = OBJECT_TO_JSVAL(%s::GetJSObject(cx, prop));\n";
"#ifdef XPIDL_JS_STUBS\n"
" *vp = OBJECT_TO_JSVAL(%s::GetJSObject(cx, prop));\n"
"#else\n"
" nsJSUtils::nsConvertXPCObjectToJSVal(prop, %s::GetIID(), cx, vp);\n"
"#endif\n";
static const char *kStringGetCaseStr =
" nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);\n";
@ -623,7 +627,7 @@ JSStubGen::GeneratePropGetter(ofstream *file,
break;
case TYPE_XPIDL_OBJECT:
case_str = buf2;
sprintf(buf2, kXPIDLObjectGetCaseStr, aAttribute.GetTypeName());
sprintf(buf2, kXPIDLObjectGetCaseStr, aAttribute.GetTypeName(), aAttribute.GetTypeName());
break;
default:
// XXX Fail for other cases