Jan 18 meeting notes

Brendan Eich brendan at mozilla.com
Thu Jan 19 16:20:08 PST 2012


> Andrea Giammarchi <mailto:andrea.giammarchi at gmail.com>
> January 19, 2012 4:10 PM
> for all WeakMap shims and examples I have seen this to guard the key 
> as object is basically:
>
> Object.isObject = function isObject() {
>   return Object(value) === value;
> };
>
> why such difference with indeed function ambiguity with your first 
> example?

We agreed not to treat functions as non-"isObject" objects.
>
> Agreed on Object.type since it's easy to monkey patch while typeof is 
> already causing my code to look like this
>
> typeof obj != "null" && typeof obj == "object" && !!obj

V8-proofing shows this, yeah. It's a good warning sign in addition to 
the sheer runtime incompatibility of changing typeof null to be "null".

So Object.type is the thing to draft. Probably it should return 
typeof-like strings with the "null" fix and only that. I do not believe 
it should start returning "array" for Array instances, or take other 
experimental risks. But we should discuss.

/be



More information about the es-discuss mailing list