Mercurial Hosting > luan
comparison src/luan/interp/EqExpr.java @ 37:8a57ebfdfd78
add JavaLib
git-svn-id: https://luan-java.googlecode.com/svn/trunk@38 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Thu, 20 Dec 2012 02:36:07 +0000 |
parents | e51906de0f11 |
children | e3624b7cd603 |
comparison
equal
deleted
inserted
replaced
36:2a35154aec14 | 37:8a57ebfdfd78 |
---|---|
18 Object o2 = op2.eval(lua); | 18 Object o2 = op2.eval(lua); |
19 if( o1 == o2 || o1 != null && o1.equals(o2) ) | 19 if( o1 == o2 || o1 != null && o1.equals(o2) ) |
20 return true; | 20 return true; |
21 if( !o1.getClass().equals(o2.getClass()) ) | 21 if( !o1.getClass().equals(o2.getClass()) ) |
22 return false; | 22 return false; |
23 LuaTable mt1 = Lua.getMetatable(o1); | 23 LuaTable mt1 = lua.getMetatable(o1); |
24 LuaTable mt2 = Lua.getMetatable(o2); | 24 LuaTable mt2 = lua.getMetatable(o2); |
25 if( mt1==null || mt2==null ) | 25 if( mt1==null || mt2==null ) |
26 return false; | 26 return false; |
27 Object f = mt1.get("__eq"); | 27 Object f = mt1.get("__eq"); |
28 if( f == null || !f.equals(mt2.get("__eq")) ) | 28 if( f == null || !f.equals(mt2.get("__eq")) ) |
29 return null; | 29 return null; |