fix regression in defun/defmethod
This commit is contained in:
@@ -152,11 +152,13 @@ class Helpers {
|
|||||||
var expr = if (body.length == 0) {
|
var expr = if (body.length == 0) {
|
||||||
EReturn(null).withMacroPosOf(if (name != null) name else argList);
|
EReturn(null).withMacroPosOf(if (name != null) name else argList);
|
||||||
} else {
|
} else {
|
||||||
k.convert(CallExp(Symbol("begin").withPos(body[0].pos), body).withPos(body[0].pos));
|
var block = k.convert(CallExp(Symbol("begin").withPos(body[0].pos), body).withPos(body[0].pos));
|
||||||
}
|
|
||||||
|
|
||||||
if (returnsValue) {
|
if (returnsValue) {
|
||||||
expr = EReturn(expr).withMacroPosOf(body[-1]);
|
EReturn(block).withMacroPosOf(body[-1]);
|
||||||
|
} else {
|
||||||
|
block;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// To make function args immutable by default, we would use (let...) instead of (begin...)
|
// To make function args immutable by default, we would use (let...) instead of (begin...)
|
||||||
|
|||||||
Reference in New Issue
Block a user