On Jul 15, 2013, at 10:30 PM, Brendan Eich wrote: > Axel Rauschmayer wrote: >>> The (x === Object(x)) test evaluates to true for value objects in this >>> proposal, though. This may break code looking for "primitives" but we need >>> to see what such code expects. Is it filtering out the legacy typeof-result >>> primitives (plus "null"), trying to find values for which typeof currently >>> returns "object" or "function"? If so, I don't see a problem: int64, >>> bignum, etc. are not legacy primitives. Is this test looking for objects >>> that are their own wrappers? Again all is well, unless "mutable wrapper" is >>> assumed -- but that's not safe in the ES5 era to assume, anyway. >> >> The most frequent use case I’ve encountered: does the value have a prototype >> (i.e., will Object.getPrototypeOf() work)? >> >> I’m assuming that value objects will have a prototype, accessible via >> Object.getPrototypeOf (?) > > Yes, they are after all value objects :-P. > > js> Object.getPrototypeOf(0UL) > 0UL >
In the latest spec. draft, Object.getPrototypeOf(new Symbol) returns null because that is what the [[GetInheritance]] MOP operation produces for exotic symbol objects. That's because symbols symbols aren't supposed to have any observable properties. [[GetInhertance]] would do something else for value objects that actually exposed inherited properties. Allen _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss