From d1c8c65022514f6c4c8d24447299c7039b88b802 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Fri, 21 Jun 2013 13:30:02 +0200 Subject: [PATCH] Convert JS AST to strings in ls-compile-toplevel --- src/compiler.lisp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/compiler.lisp b/src/compiler.lisp index a81de2f..f82bda4 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -1495,14 +1495,13 @@ (min width (length string))))) (subseq string 0 n))) -(defun ls-compile-toplevel (sexp &optional multiple-value-p) +(defun convert-toplevel (sexp &optional multiple-value-p) (let ((*toplevel-compilations* nil)) (cond ((and (consp sexp) (eq (car sexp) 'progn)) - (let ((subs (mapcar (lambda (s) - (ls-compile-toplevel s t)) - (cdr sexp)))) - (join subs))) + (mapcar (lambda (s) + (ls-compile-toplevel s t)) + (cdr sexp))) (t (when *compile-print-toplevels* (let ((form-string (prin1-to-string sexp))) @@ -1511,4 +1510,7 @@ `(code ,@(interleave (get-toplevel-compilations) ";" t) ,(when code - `(code ,code ";")))))))) + `(code ,code ";")))))))) + +(defun ls-compile-toplevel (sexp &optional multiple-value-p) + (js (convert-toplevel sexp multiple-value-p))) -- 1.7.10.4