lookup getter for host properties

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

lookup getter for host properties

Hallvord Reiar Michaelsen Steen-3
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.

--
Hallvord R. M. Steen
Core QA JavaScript tester, Opera Software
http://www.opera.com/
Opera - simply the best Internet experience
_______________________________________________
Es4-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es4-discuss
Reply | Threaded
Open this post in threaded view
|

Re: lookup getter for host properties

Lars T Hansen-2
On 9/14/07, Hallvord R. M. Steen <[hidden email]> 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
_______________________________________________
Es4-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es4-discuss