lookup getter for host properties

Hallvord R. M. Steen hallvord at opera.com
Fri Sep 14 05:43:33 PDT 2007


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



More information about the Es4-discuss mailing list