typeof symbol (Was: Sept 19 TC39 Meeting Notes)

Axel Rauschmayer axel at rauschma.de
Sat Sep 29 16:23:30 PDT 2012


> Axel Rauschmayer wrote:
>>> What's the underlying theory for extending instanceof?
>> 
>> The idea would be to not use the proto chain (which would be odd for primitive values, anyway), to make these “pseudo-types” special.
> 
> That's not much of a theory :-P. So hardcode two or three special cases? Yikes.

With contracts/guards, it would be more than three cases. One could always introduce a protocol. I’m not saying that that’s the (only) way to do it, I’m just saying that it would be nice not to have to deal with the current “cross-frame, primitive vs. object, [[Class]] vs. instanceof” mess. typeof is already hard-coded.

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120930/03a83c68/attachment.html>


More information about the es-discuss mailing list