Mercurial Hosting > luan
comparison src/luan/Luan.java @ 85:b2551f00bc51
fix type()
git-svn-id: https://luan-java.googlecode.com/svn/trunk@86 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Mon, 25 Feb 2013 03:53:54 +0000 |
parents | f7e17cfb35f9 |
children | 6ca02b188dba |
comparison
equal
deleted
inserted
replaced
84:cca4f8522893 | 85:b2551f00bc51 |
---|---|
11 return "string"; | 11 return "string"; |
12 if( obj instanceof Boolean ) | 12 if( obj instanceof Boolean ) |
13 return "boolean"; | 13 return "boolean"; |
14 if( obj instanceof Number ) | 14 if( obj instanceof Number ) |
15 return "number"; | 15 return "number"; |
16 if( obj instanceof LuanTable ) | |
17 return "table"; | |
18 if( obj instanceof LuanFunction ) | |
19 return "function"; | |
16 return "userdata"; | 20 return "userdata"; |
17 } | 21 } |
18 | 22 |
19 public static boolean toBoolean(Object obj) { | 23 public static boolean toBoolean(Object obj) { |
20 return obj != null && !Boolean.FALSE.equals(obj); | 24 return obj != null && !Boolean.FALSE.equals(obj); |