Hi all,
        I stumbled across the following method definition in an IDL:

   void doSomething(in nsIIDRef iid,[iid_is(iid)] in nsISupports s);

Note that the last param specified iid_is, but is "in".

I understand that it doesn't make a real lot of sense, but my question 
simply is "is it legal"?

Searching around the docs, I find 
http://www.mozilla.org/scriptable/xpidl/notes/keywords.txt, which states:

"""
iid_is     // used to say that some other param indicates at runtime
            // the interfcace type for this out param (in [])
"""

I also found 
http://www.mozilla.org/scriptable/xpidl/idl-authors-guide/keywords.html, 
which says:

"""
Used to declare that some other param indicates (at runtime) the 
interface type for this out param. You almost certainly won't need to 
use this.
"""

So the docs seem to imply it is _not_ legal.  However, xpidl lets it 
pass without warning.

The bigger problem is when Python (and possibly js - haven't tried yet) 
attempts to call nsIInterfaceInfo::GetIIDForParam() - xptcall asserts in 
this block:

     if(XPT_TDP_TAG(td->prefix) != TD_INTERFACE_TYPE) {
         NS_ASSERTION(0, "not an interface");
         return NS_ERROR_INVALID_ARG;
     }

So - it seems we have a bug _somewhere_.  My question is where :-) 
Should this be considered a bug in xpidl for allowing that construct, or 
in xptcall for failing to get the IID?

Thanks,

Mark.


Reply via email to