From: David Vázquez Date: Thu, 20 Jun 2013 23:30:06 +0000 (+0200) Subject: Bug generating Javascript code for (PROGN (PROGN)) X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=452123400b2a8123a445ccd274cc99a3fed1eea4;hp=afb6a14b45bf0734ce9b06d3c299036ad8792d40;p=jscl.git Bug generating Javascript code for (PROGN (PROGN)) --- diff --git a/src/compiler-codegen.lisp b/src/compiler-codegen.lisp index fbb3952..f3b05cc 100644 --- a/src/compiler-codegen.lisp +++ b/src/compiler-codegen.lisp @@ -358,7 +358,7 @@ (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))) @@ -415,7 +415,9 @@ (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 "}"))))