Mercurial Hosting > luan
changeset 683:67dd1449e354
fix java security
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 14 Apr 2016 21:51:55 -0600 |
parents | 0c334975d526 |
children | 41f791e4206d |
files | core/src/luan/LuanException.java core/src/luan/modules/JavaLuan.java |
diffstat | 2 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/core/src/luan/LuanException.java Thu Apr 14 21:41:40 2016 -0600 +++ b/core/src/luan/LuanException.java Thu Apr 14 21:51:55 2016 -0600 @@ -125,4 +125,10 @@ return sb.toString(); } + public static String currentSource() { + LuanException ex = new LuanException("currentSource"); + List<StackTraceElement> st = ex.justLuan(); + return st.isEmpty() ? null : st.get(0).getFileName(); + } + }
--- a/core/src/luan/modules/JavaLuan.java Thu Apr 14 21:41:40 2016 -0600 +++ b/core/src/luan/modules/JavaLuan.java Thu Apr 14 21:51:55 2016 -0600 @@ -27,7 +27,7 @@ public final class JavaLuan { public static void java(LuanState luan) throws LuanException { - check(luan,"fix later"); + check(luan,LuanException.currentSource()); luan.java.ok = true; }