What is an Object Type(O)?
Allen.Wirfs-Brock at microsoft.com
Sat Mar 7 15:54:03 PST 2009
From: Juriy Zaytsev [mailto:kangax at gmail.com]
Sent: Saturday, March 07, 2009 11:32 AM
My initial test tries to rule out exactly all of the "ECMAScript language types" except an Object one - Undefined, Null, Boolean, String and Number. I think of these types as of "primitives", therefore `isPrimitive` function name : ) If a value passed to `Object.keys` is in a subset of these "language types", then my test should work properly. If, on the other hand, a value is one of the "specification types" - there will be false positives. From what I understand, I shouldn't worry about specification types, as none of them seem to be able to make its way as an argument of `Object.keys`. Am I correct?
As far as I know, there is no way for a specification type value to become an actual parameter or the this value of a function activation. However, the result of function call (if the function is a host function) and some operators may be a Reference value. That is one of the reasons ToValue calls appears where they do, including on argument expressions before they are passed.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Es-discuss