Enhance binary compare operators, especially equals, to more closely match what standard lua does.
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
package lua.value;
|
||||
|
||||
import lua.Lua;
|
||||
|
||||
abstract
|
||||
public class LNumber extends LValue {
|
||||
|
||||
/** Compare for equivalence by using lua op comparator */
|
||||
public boolean equals(Object o) {
|
||||
if ( ! ( o instanceof LValue) )
|
||||
return false;
|
||||
LValue v = (LValue) o;
|
||||
return this.luaBinCmpUnknown(Lua.OP_EQ, v );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user