Subj : Re: SM typeof for extensions To : netscape.public.mozilla.jseng From : Shanti Rao Date : Thu Sep 09 2004 04:07 pm Brendan Eich wrote: > Shanti Rao wrote: > >> Howdy, >> >> If I add a class to SM, how do I have the tyopeof operator return >> something other than "object"? >> >> js>var s = new ActiveX("SAPI.SpVoice"); >> js>typeof s >> object >> >> I want it to say "ActiveX" instead of "object". > > > Is this some evil MS-ism? Tee hee. I also have Stream, File, ODBC, and Mail classes. ActiveX was just first on the list. > With E4X, there may be a general way to change the result of typeof. > Right now, you'll have to hack jsapi.c. Gross. My workaround is to give the prototype a "className" property. Does anyone else want to suggest a convention for solving this? Shanti .