Subj : Re: Question on js_LookupPropertyWithFlags To : netscape.public.mozilla.jseng From : Brendan Eich Date : Wed Sep 21 2005 05:56 pm Brendan Eich wrote: > What you write seems to suggest that a JSNewResolveOp could somehow > start the lookup at a different object from the one directly accessed by > the higher-level get or set operation that triggers the lookup. That > can't work, given that lookup calls resolve, not the other way around, > and that you have to start somewhere to call resolve once, so you can't > call resolve to get the starting object. But, you can use JSCLASS_NEW_RESOLVE to redirect a get or set operation from whatever object, starting from the "start" object, has the id being looked up bound to a property, by setting *objp to another object than the one passed into JSNewResolveOp as |obj|. Originally you could set *objp only to another object further along the prototype chain, but in the 1.8 trunk milestone, this was enhanced so you can redirect to an arbitrary object. Doing so can be costly, however, since the interpreter will have to look up and redirect on every access, and worse, the property cache will know not to cache such a case (it can't cache such redirects). /be .