Gary Guo (2015-01-05T03:09:27.000Z)
I agree that use equals is a better choice. If operator overloading is implemented, you may experience inconsistency (different instance of builtin boxed values would be unequal according to default semantics, while after overloaded == operator it becomes equal.)
Date: Sat, 3 Jan 2015 23:52:58 -0200
From: fakedme+es at gmail.com
To: es-discuss at mozilla.org
Subject: Overriding the == operator, like in Java/Lua/Python/whatever.


  
    
  
  
    I've been looking and looking and looking and I
      couldn't find a way to override == to make 2 different instances
      of MyPoint compare == if they have the same coordinates. (I
    guess this also applies to String objects and stuff but I haven't
    tested that)

    

    So how do I do this?

    

    (PS: yes, I know, Java has an .equals method, not overridable ==,
    but it's basically the same thing)
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150105/acf88c89/attachment.html>
d at domenic.me (2015-01-12T21:26:03.531Z)
I agree that use equals is a better choice. If operator overloading is implemented, you may experience inconsistency (different instance of builtin boxed values would be unequal according to default semantics, while after overloaded == operator it becomes equal.)