diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/jvm/clojure/lang/Compiler.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/jvm/clojure/lang/Compiler.java b/src/jvm/clojure/lang/Compiler.java index 4b87bf71..bb933d7a 100644 --- a/src/jvm/clojure/lang/Compiler.java +++ b/src/jvm/clojure/lang/Compiler.java @@ -2360,7 +2360,7 @@ static class FnExpr implements Expr{ //arglist might be preceded by symbol naming this fn if(RT.second(form) instanceof Symbol) { - fn.thisName = ((Symbol)RT.second(form)).name; + fn.thisName = ((Symbol) RT.second(form)).name; form = RT.cons(FN, RT.rest(RT.rest(form))); } @@ -2693,7 +2693,7 @@ static class FnMethod{ //register 'this' as local 0 //registerLocal(THISFN, null, null); - registerLocal(Symbol.intern(fn.thisName != null?fn.thisName:"fn__" + RT.nextID()), null, null); + registerLocal(Symbol.intern(fn.thisName != null ? fn.thisName : "fn__" + RT.nextID()), null, null); PSTATE state = PSTATE.REQ; PersistentVector argLocals = PersistentVector.EMPTY; @@ -3143,7 +3143,11 @@ static public Var isMacro(Object op) throws Exception{ { Var v = (op instanceof Var) ? (Var) op : lookupVar((Symbol) op, false); if(v != null && v.isMacro()) + { + if(v.ns != currentNS() && !v.isExported()) + throw new IllegalAccessError("var: " + v + " is not exported"); return v; + } } return null; } |