From 72e973cf04cbeb9a46f420bda3d593adee470e0f Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Sun, 23 Jun 2013 15:29:06 +0200 Subject: [PATCH] Migrate LAMBDA-NAME/DOCSTRING-WRAPPER --- src/compiler.lisp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/compiler.lisp b/src/compiler.lisp index 6605dde..1f14de5 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -246,16 +246,14 @@ (ll-optional-arguments-canonical lambda-list)))) (remove nil (mapcar #'third args)))) -(defun lambda-name/docstring-wrapper (name docstring &rest code) +(defun lambda-name/docstring-wrapper (name docstring code) (if (or name docstring) - (js!selfcall - "var func = " `(code ,@code) ";" - (when name - `(code "func.fname = " ,(js-escape-string name) ";")) - (when docstring - `(code "func.docstring = " ,(js-escape-string docstring) ";")) - "return func;") - `(code ,@code))) + (js!selfcall* + `(var (func ,code)) + (when name `(= (get func |fname|) ,name)) + (when docstring `(= (get func |docstring|) ,docstring)) + `(return func)) + `(code ,code))) (defun lambda-check-argument-count (n-required-arguments n-optional-arguments rest-p) -- 1.7.10.4