Nest host validation vs NestHost attribute performed by Lookup::defineHiddenClass

Peter Levart peter.levart at gmail.com
Fri Oct 4 16:10:24 UTC 2019



On 10/2/19 7:07 PM, Mandy Chung wrote:
>
>
> On 10/2/19 2:11 AM, Peter Levart wrote:
>> Ok, I see now that it is best for getNestMates() to be static only. 
>> In case of a nest with a normal named NH, this method would only 
>> return the statically defined mates without any hidden classes added 
>> dynamically. So why would this method need to return any members for 
>> hidden only nest? This would mean that it behaves differently 
>> depending on whether there is a normal named class in the nest or not.
>
> getNestMembers does not return any dynamically added members 
> regardless of the host is a hidden class or non-hidden.    It returns 
> an array of at least one element, the zeroth element is the nest host 
> which can be a hidden class.  So for a hidden only nest, I see 
> getNestMembers behaves consistently with an ordinary class with no NH 
> attribute (i.e. no static members) and returns 1-element array 
> consisting only the nest host.
>
> Mandy

Ok, this can also be counted as consistent. getNestMembers() therefore 
never returns hidden non-nest-host (nest-guest?) classes.

Regards, Peter



More information about the valhalla-dev mailing list