comparison core/src/luan/LuanException.java @ 572:f1601a4ce1aa

fix stack when calling meta-methods
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 12 Jul 2015 21:34:23 -0600
parents f99c79b0b426
children 7c3ad6db8ac3
comparison
equal deleted inserted replaced
571:cd944b010f25 572:f1601a4ce1aa
10 private LuanException(String msg,Throwable cause) { 10 private LuanException(String msg,Throwable cause) {
11 super(msg,cause); 11 super(msg,cause);
12 } 12 }
13 13
14 LuanException(LuanBit bit,Object msg) throws LuanException { 14 LuanException(LuanBit bit,Object msg) throws LuanException {
15 this( bit.luan.toString(msg), msg instanceof Throwable ? (Throwable)msg : null ); 15 this( bit.toString(msg), msg instanceof Throwable ? (Throwable)msg : null );
16 table.rawPut( "java", this ); 16 table.rawPut( "java", this );
17 table.rawPut( "message", msg ); 17 table.rawPut( "message", msg );
18 table.rawPut( "message_string", bit.luan.toString(msg) ); 18 table.rawPut( "message_string", bit.toString(msg) );
19 for( StackTraceElement ste : bit.stackTrace() ) { 19 for( StackTraceElement ste : bit.stackTrace() ) {
20 LuanTable tbl = new LuanTable(); 20 LuanTable tbl = new LuanTable();
21 tbl.rawPut( "source", ste.call.source.name ); 21 tbl.rawPut( "source", ste.call.source.name );
22 tbl.rawPut( "line", ste.call.lineNumber() ); 22 tbl.rawPut( "line", ste.call.lineNumber() );
23 tbl.rawPut( "call_to", ste.fnName ); 23 tbl.rawPut( "call_to", ste.fnName );