Mercurial Hosting > luan
comparison src/luan/modules/BasicLuan.java @ 1166:7ef40e1923b7
add back Thread.global
allow metatables to have metatables
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 08 Feb 2018 02:22:51 -0700 |
parents | 1f9d34a6f308 |
children | 73d754b1889f |
comparison
equal
deleted
inserted
replaced
1165:668f29bc52ea | 1166:7ef40e1923b7 |
---|---|
69 return null; | 69 return null; |
70 Object obj = metatable.rawGet("__metatable"); | 70 Object obj = metatable.rawGet("__metatable"); |
71 return obj!=null ? obj : metatable; | 71 return obj!=null ? obj : metatable; |
72 } | 72 } |
73 | 73 |
74 public static void set_metatable(LuanTable table,LuanTable metatable) throws LuanException { | 74 public static void set_metatable(LuanState luan,LuanTable table,LuanTable metatable) throws LuanException { |
75 Utils.checkNotNull(table); | 75 Utils.checkNotNull(table); |
76 if( table.getHandler("__metatable") != null ) | 76 if( table.getHandler(luan,"__metatable") != null ) |
77 throw new LuanException("cannot change a protected metatable"); | 77 throw new LuanException("cannot change a protected metatable"); |
78 table.setMetatable(metatable); | 78 table.setMetatable(metatable); |
79 } | 79 } |
80 | 80 |
81 public static boolean raw_equal(Object v1,Object v2) { | 81 public static boolean raw_equal(Object v1,Object v2) { |