lookup getter for host properties

# Hallvord R. M. Steen (18 years ago)

while working on Opera 9.5's support for getters and setters, we've
discussed whether it should be possible to lookup a getter/setter for a
native (host) property. For example, something like

func = Element.lookupGetter('innerHTML');

// func is now a function that does serialization of nodes

func.call(document.body); // would return BODY's innerHTML

..or something like that. Or, to provide an example that stays within the
ES spec instead of venturing into the DOM:

func = Array.lookupGetter_('length'); // func is now a function that counts array elements..

Is this something worth implementing and/or standardising?

Sorry if this is already covered by the spec or previously discussed.

# Lars T Hansen (18 years ago)

On 9/14/07, Hallvord R. M. Steen <hallvord at opera.com> wrote:

Hi, while working on Opera 9.5's support for getters and setters, we've discussed whether it should be possible to lookup a getter/setter for a native (host) property. For example, something like

func = Element.lookupGetter('innerHTML');

// func is now a function that does serialization of nodes

func.call(document.body); // would return BODY's innerHTML

..or something like that. Or, to provide an example that stays within the ES spec instead of venturing into the DOM:

func = Array.lookupGetter_('length'); // func is now a function that counts array elements..

Is this something worth implementing and/or standardising?

Sorry if this is already covered by the spec or previously discussed.

define{G,S}etter/lookup{G,S}etter will not be defined by ES4 the way things look now, so all of that is outside the upcoming spec.