From: David Vázquez Date: Thu, 27 Jun 2013 13:59:14 +0000 (+0200) Subject: Migrate FUNCALL X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=6bc11ba49716b832c802c1acd6ebd2ee3fa91690;p=jscl.git Migrate FUNCALL --- diff --git a/src/compiler.lisp b/src/compiler.lisp index a903fbd..09ca814 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -1195,15 +1195,14 @@ (== (get x "stringp") 1)))))) (define-raw-builtin funcall (func &rest args) - (js!selfcall - "var f = " (ls-compile func) ";" - "return (typeof f === 'function'? f: f.fvalue)(" - `(code - ,@(interleave (list* (if *multiple-value-p* "values" "pv") - (integer-to-string (length args)) - (mapcar #'ls-compile args)) - ", ")) - ")")) + (js!selfcall* + `(var (f ,(ls-compile func))) + `(return (call (if (=== (typeof f) "function") + f + (get f "fvalue")) + ,@(list* (if *multiple-value-p* '|values| '|pv|) + (length args) + (mapcar #'ls-compile args)))))) (define-raw-builtin apply (func &rest args) (if (null args)