comparison src/luan/LuanException.java @ 1267:9fa8b8389578

add LuanTable.luan; support metatable __gc(); add luan.sql;
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 12 Nov 2018 02:10:41 -0700
parents 442abdfff437
children 2531942abaf3
comparison
equal deleted inserted replaced
1266:05934fbf635a 1267:9fa8b8389578
33 @Override public void deepenClone(LuanCloneable dc,LuanCloner cloner) { 33 @Override public void deepenClone(LuanCloneable dc,LuanCloner cloner) {
34 LuanException clone = (LuanException)dc; 34 LuanException clone = (LuanException)dc;
35 clone.table = (LuanTable)cloner.clone(table); 35 clone.table = (LuanTable)cloner.clone(table);
36 } 36 }
37 37
38 public LuanTable table() { 38 public LuanTable table(LuanState luan) {
39 if( table==null ) { 39 if( table==null ) {
40 table = new LuanTable(); 40 table = new LuanTable(luan);
41 table.rawPut( "java", this ); 41 table.rawPut( "java", this );
42 LuanTable metatable = new LuanTable(); 42 LuanTable metatable = new LuanTable(luan);
43 table.setMetatable(metatable); 43 table.setMetatable(metatable);
44 try { 44 try {
45 table.rawPut( "get_message", new LuanJavaFunction( 45 table.rawPut( "get_message", new LuanJavaFunction(
46 LuanException.class.getMethod( "getMessage" ), this 46 LuanException.class.getMethod( "getMessage" ), this
47 ) ); 47 ) );