Mercurial Hosting > luan
comparison core/src/luan/impl/SetTableEntry.java @ 460:b48cfa14ba60
improve stack trace
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 06 May 2015 14:32:29 -0600 |
parents | df95199ca4c0 |
children | 92c3d22745b8 |
comparison
equal
deleted
inserted
replaced
459:30544d1a9cbf | 460:b48cfa14ba60 |
---|---|
2 | 2 |
3 import luan.LuanException; | 3 import luan.LuanException; |
4 import luan.LuanTable; | 4 import luan.LuanTable; |
5 import luan.Luan; | 5 import luan.Luan; |
6 import luan.LuanFunction; | 6 import luan.LuanFunction; |
7 import luan.LuanSource; | 7 import luan.LuanElement; |
8 import luan.LuanMeta; | 8 import luan.LuanMeta; |
9 import luan.modules.JavaLuan; | 9 import luan.modules.JavaLuan; |
10 | 10 |
11 | 11 |
12 final class SetTableEntry extends CodeImpl implements Settable { | 12 final class SetTableEntry extends CodeImpl implements Settable { |
13 private final Expr tableExpr; | 13 private final Expr tableExpr; |
14 private final Expr keyExpr; | 14 private final Expr keyExpr; |
15 | 15 |
16 SetTableEntry(LuanSource.Element se,Expr tableExpr,Expr keyExpr) { | 16 SetTableEntry(LuanElement el,Expr tableExpr,Expr keyExpr) { |
17 super(se); | 17 super(el); |
18 this.tableExpr = tableExpr; | 18 this.tableExpr = tableExpr; |
19 this.keyExpr = keyExpr; | 19 this.keyExpr = keyExpr; |
20 } | 20 } |
21 | 21 |
22 @Override public void set(LuanStateImpl luan,Object value) throws LuanException { | 22 @Override public void set(LuanStateImpl luan,Object value) throws LuanException { |
30 return; | 30 return; |
31 } | 31 } |
32 if( t != null && luan.currentEnvironment().hasJava() ) | 32 if( t != null && luan.currentEnvironment().hasJava() ) |
33 JavaLuan.__new_index(luan,t,key,value); | 33 JavaLuan.__new_index(luan,t,key,value); |
34 else | 34 else |
35 throw luan.bit(se).exception( "attempt to index '"+tableExpr.se().text()+"' (a " + Luan.type(t) + " value)" ); | 35 throw luan.bit(el).exception( "attempt to index '"+tableExpr.el().text()+"' (a " + Luan.type(t) + " value)" ); |
36 } | 36 } |
37 | 37 |
38 } | 38 } |