projects
/
jscl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bug generating Javascript code for (PROGN (PROGN))
[jscl.git]
/
src
/
compiler-codegen.lisp
diff --git
a/src/compiler-codegen.lisp
b/src/compiler-codegen.lisp
index
fbb3952
..
f3b05cc
100644
(file)
--- a/
src/compiler-codegen.lisp
+++ b/
src/compiler-codegen.lisp
@@
-358,7
+358,7
@@
(destructuring-bind (&body body) (cdr form)
(cond
((null body) '(empty))
(destructuring-bind (&body body) (cdr form)
(cond
((null body) '(empty))
- ((null (cdr body)) (car body))
+ ((null (cdr body)) (js-expand-stmt (car body)))
(t `(group ,@(cdr form))))))
(t
form)))
(t `(group ,@(cdr form))))))
(t
form)))
@@
-415,7
+415,9
@@
(js-format " else ")
(js-stmt false))))
(group
(js-format " else ")
(js-stmt false))))
(group
- (let ((in-group-p (and (consp parent) (eq (car parent) 'group))))
+ (let ((in-group-p
+ (or (null parent)
+ (and (consp parent) (eq (car parent) 'group)))))
(unless in-group-p (js-format "{"))
(mapc #'js-stmt (cdr form))
(unless in-group-p (js-format "}"))))
(unless in-group-p (js-format "{"))
(mapc #'js-stmt (cdr form))
(unless in-group-p (js-format "}"))))