Subj : Re: argv argument to JS_InstanceOf To : netscape.public.mozilla.jseng From : Braden McDaniel Date : Thu Aug 14 2003 11:15 am On Wed, 13 Aug 2003 23:35:32 -0700, Brendan Eich wrote: > Braden McDaniel wrote: > >>On Sun, 10 Aug 2003 22:16:26 -0700, Brendan Eich wrote: >> >> >> >>>What the docs are trying to say is that if you want to check whether an >>>object is an instance of a class without errors (as exceptions, unless >>>OOM, in the modern engine) being reported/thrown, pass NULL for argv. >>>If you are OTOH calling JS_InstanceOf from a native function and *want* >>>an error report implicating the native's "obj" parameter as not being of >>>the right class, while also naming the native function, then pass argv. >>> >>> >> >>Will vp work just as well when inside a JSPropertyOp? >> > > No. > > It's harder to cause the wrong |obj| parameter to be passed to your > class's getProperty or setProperty. You have to delegate to a prototype > object other than the class prototype. Either someone is using > JS_SetPrototype, or someone must be mucking directly with __proto__. I'm not worried about obj. The situation I have is for an element setter. I need to make sure that *vp is an object of the correct type. I guess I just have to use JS_ReportError. -- Braden McDaniel e-mail: Jabber: .