lookup getter for host properties

Lars T Hansen lth at acm.org
Fri Sep 14 05:47:16 PDT 2007


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.

--lars



More information about the Es4-discuss mailing list