> 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
[email protected]

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

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to