Subj : Re: JS_GetClass won't return proper class name. To : netscape.public.mozilla.jseng From : Brendan Eich Date : Tue Mar 29 2005 11:15 am Mike Moening wrote: > > In short here is what I did: > > ctor = JS_GetConstructor(cx, JS_GetPrototype(cx, obj)); Note that you could pass obj to JS_GetConstructor directly, so long as obj doesn't "shadow" the prototype 'constructor' property with a different-valued one of the same name. > Unfortunately the "results" and "n" properities show up in the properties > listing twice. > Once standing alone and once under the Factorial "object" when I recursively > call GetPropertyDescArray() on the object. The only reason n and results could show up on the global object is because you call Factorial() directly (no operator new). Do you do that? If you do, then |this| binds (as usual) to the global object -- the object in which 'Factorial' was found on the scope chain. /be .