Operator overloading for non-value objects

Kevin Smith zenparsing at gmail.com
Tue Jan 14 18:19:46 PST 2014


>
> So glad you asked, and you will like the answer:
>
> js> 0L == "0"
> typein:2:0 TypeError: no operator function found for ==
>

...and..I..do  : )

http://goo.gl/N5txLJ

>
>    - The strict equality operators, === and !==, cannot be overloaded
>    - They work on frozen-by-definition value objects via a structural
>    recursive strict equality test (beware, NaN !== NaN)
>    - Same-object-reference remains a fast-path optimization
>
> Looks pretty solid to me - thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140114/305cebc5/attachment.html>


More information about the es-discuss mailing list