Subj : Re: Private Data and Prototype Inheritance To : netscape.public.mozilla.jseng From : "Kevin Lindsey" Date : Fri Jan 09 2004 05:57 pm Brendan Eich wrote: > You can't delegate method calls from an object lacking private data to > one having private data, unless the prototype's getter/setter use the > prototype's privates, which would in general make a pigeon-hole problem > (only one prototype, many delegating instances). Exactly! Hence the approach I was attempting to use. > You could wrap, instead, but then you have to make a Line for every > FancyLine. Yeah, I would like to avoid that approach. > Alternatively, you could avoid private data and use property storage. > Then delegation works as usual. Ah, OK. So, I would setProperty my private data in the native base class' constructor. Then, using Line.apply(this, arguments), the derived object will get its own version of the "private data" property. That makes sense. Is there a idiom or recommended way of converting to and from jsvals and pointers? It seems that I would have to use a jsdouble or string since ints are shifted internally. Thanks a lot for your help. Kevin .