From 6c4af9e1276d70e4cbc66da935a229bdabce43ce Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Fri, 5 Jul 2013 04:36:30 +0200 Subject: [PATCH] Remigrate MULTIPLE-VALUE-CALL (correctly) --- src/compiler.lisp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/compiler.lisp b/src/compiler.lisp index 23752c6..d939651 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -901,22 +901,22 @@ (define-compilation multiple-value-call (func-form &rest forms) (js!selfcall* - `(var (func ,(ls-compile func-form)) - (args ,(vector (if *multiple-value-p* '|values| '|pv|) 0)) - (|values| |mv|) - vs) - `(progn - ,@(mapcar (lambda (form) - `(progn - (= vs ,(ls-compile form t)) - (if (and (=== (typeof vs) "object") - (in "multiple-value" vs)) - (= args (call (get args "concat") vs)) - (call (get args "push") vs)))) - forms)) - `(= (property args 1) (- (get args "length") 2)) - `(return (call (get func "apply") |window| args)))) - + `(var (func ,(ls-compile func-form))) + `(var (args ,(vector (if *multiple-value-p* '|values| '|pv|) 0))) + `(return + ,(js!selfcall* + `(var (|values| |mv|)) + `(var vs) + `(progn + ,@(with-collect + (dolist (form forms) + (collect `(= vs ,(ls-compile form t))) + (collect `(if (and (=== (typeof vs) "object") + (in "multiple-value" vs)) + (= args (call (get args "concat") vs)) + (call (get args "push") vs)))))) + `(= (property args 1) (- (property args "length") 2)) + `(return (call (get func "apply") |window| args)))))) (define-compilation multiple-value-prog1 (first-form &rest forms) (js!selfcall -- 1.7.10.4