(8.6.2) [[Get]], [[Put]] and host objects.

Jorge Chamorro jorge at jorgechamorro.com
Tue Apr 7 15:49:32 PDT 2009


(8.6.2)

(...)
"[[Put]] (PropertyName, Value) Sets the specified property to Value. "
"[[Get]] (PropertyName) Returns the value of the property."
(...)
"Every object (including host objects) must implement the  
[[Prototype]] and [[Class]] properties and the [[Get]], [[Put]],  
[[CanPut]], [[HasProperty]], [[Delete]], and [[DefaultValue]] methods."
(...)
"Host objects may implement these methods in any manner unless  
specified otherwise; for example, one possibility is that [[Get]] and  
[[Put]] for a particular host object indeed fetch and store property  
values but [[HasProperty]] always generates false. "

That "Host objects may implement these methods in any manner" means  
that a host object's [[Put]] might indeed not "Set the specified  
property to Value", or that a host object's [[Get]] might indeed not  
"Return the value of the property" ?

FireFox, Safari, Opera and Chrome (seemingly) support augmenting host  
objects, but I'm not sure if it's safe to expect this ability in other  
conforming browsers. (?)

Needless to say the ability to attach properties to 'htmlElements' is  
a very-very convenient thing...

TIA,
-- 
Jorge.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20090408/b516993c/attachment.html>


More information about the es-discuss mailing list