diff options
author | Rich Hickey <richhickey@gmail.com> | 2008-01-01 20:04:00 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2008-01-01 20:04:00 +0000 |
commit | 9576e7b2edf541f63dc8592d3cf629dfe21a06f5 (patch) | |
tree | 201f5e25213c3157b0ee20e114c2787eb9ada4eb /src | |
parent | c78855af24bd4cc2f9895d8b2dc4a7fced8453f3 (diff) |
wrap evals of throw in fn context
Diffstat (limited to 'src')
-rw-r--r-- | src/jvm/clojure/lang/Compiler.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/jvm/clojure/lang/Compiler.java b/src/jvm/clojure/lang/Compiler.java index 799c2aaa..3df045ce 100644 --- a/src/jvm/clojure/lang/Compiler.java +++ b/src/jvm/clojure/lang/Compiler.java @@ -1464,11 +1464,7 @@ static class ThrowExpr extends UntypedExpr{ public Object eval() throws Exception{ - Object t = excExpr.eval(); - if(t instanceof Exception) - throw (Exception) t; - else - throw (Error) t; + throw new Exception("Can't eval throw"); } public void emit(C context, FnExpr fn, GeneratorAdapter gen){ @@ -1479,6 +1475,8 @@ static class ThrowExpr extends UntypedExpr{ static class Parser implements IParser{ public Expr parse(C context, Object form) throws Exception{ + if(context == C.EVAL) + return analyze(context, RT.list(RT.list(FN, PersistentVector.EMPTY, form))); return new ThrowExpr(analyze(C.EXPRESSION, RT.second(form))); } } |