From 9cb8d0dd16c5aa94939099d8db0e4e2a800fe9a9 Mon Sep 17 00:00:00 2001 From: Vladimir Sedach Date: Sat, 17 Apr 2010 20:25:52 -0400 Subject: [PATCH] Refactored symbol-to-js-string function. --- src/namespace.lisp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/namespace.lisp b/src/namespace.lisp index 8e784c4..22f0863 100644 --- a/src/namespace.lisp +++ b/src/namespace.lisp @@ -27,11 +27,11 @@ (defmacro ps-package-prefix (package) `(gethash (find-package ,package) *package-prefix-table*)) -(defun symbol-to-js-string (symbol &optional (mangle-symbol-name t)) - (let ((symbol-name (funcall (if mangle-symbol-name - #'symbol-name-to-js-string - #'symbol-name) - (maybe-obfuscate-symbol symbol)))) +(defun symbol-to-js-string (symbol &optional (mangle-symbol-name? t)) + (let* ((symbol-name (symbol-name (maybe-obfuscate-symbol symbol))) + (identifier (if mangle-symbol-name? + (encode-js-identifier symbol-name) + symbol-name))) (aif (ps-package-prefix (symbol-package symbol)) - (concatenate 'string it symbol-name) - symbol-name))) + (concatenate 'string it identifier) + identifier))) -- 2.11.4.GIT