Wrap non-trivial functions with parenthesis
authorDavid Vázquez <davazp@gmail.com>
Thu, 27 Jun 2013 00:37:42 +0000 (02:37 +0200)
committerDavid Vázquez <davazp@gmail.com>
Thu, 27 Jun 2013 00:37:42 +0000 (02:37 +0200)
src/compiler-codegen.lisp

index e82b841..166c7f9 100644 (file)
        (js-format "~a" (apply #'code args)))
       ;; Function call
       (call
-       (js-expr (car args))
+       (if (symbolp (car args))
+           (js-expr (car args))
+           (progn
+             (js-format "(")
+             (js-expr (car args))
+             (js-format ")")))
        (js-format "(")
        (when (cdr args)
          (with-operator (12 'left)