Title: Overloading functions

I am looking for a way to return different variable types to Javascript through XPConnect through the same function. I see that there is no way to overload a function in idl, however I was wondering if anyone had any tricks that would allow a Javascript developer to say:

var str = plugin.GetValue("value")

and have the return be either a number type or a string type depending on the output of the function. I am defining the function in C++ in a plugin. I think a LiveConnect plugin used to be able to do this by simply returning generic Java object which would then be converted into the appropriate type for JavaScript. I think that idl is to thin to do this kind of conversion.

Are there any known hacks to this problem?

Thanks,
-Paul

Reply via email to