Should host objects be able to have [[Class]] "Function", "Array" etc.?
david.hopwood at industrial-designers.co.uk
Mon Nov 17 20:50:47 PST 2008
David-Sarah Hopwood wrote:
> In ES3, the 'document.all' and 'filter' hacks are both clearly
> nonconformant, because an IfStatement checks only the result of
> ToBoolean applied to its condition, and ToBoolean is required to
> return true for all objects and non-zero-length strings.
... and note that this is regardless of the value of the object's
[[Class]] property, and so these hacks are not relevant to the original
topic of the thread. Specifically, an object with [[Class]] "Boolean"
and [[value]] false must still return true from ToBoolean, and must
be treated as true in an 'if' condition. Similarly for any object
with [[Class]] "String".
More information about the Es-discuss