From: David Vázquez Date: Thu, 27 Jun 2013 00:37:42 +0000 (+0200) Subject: Wrap non-trivial functions with parenthesis X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=5e830cf64b2bd21333fd733706fe393a218e5550;p=jscl.git Wrap non-trivial functions with parenthesis --- diff --git a/src/compiler-codegen.lisp b/src/compiler-codegen.lisp index e82b841..166c7f9 100644 --- a/src/compiler-codegen.lisp +++ b/src/compiler-codegen.lisp @@ -219,7 +219,12 @@ (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)