From: Raimon Grau Date: Thu, 2 May 2013 19:39:35 +0000 (+0200) Subject: fixed format for compatibility with new char implementation X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=e9019fb3b42f5b53ab7afabae167f6fccb4933b9;p=jscl.git fixed format for compatibility with new char implementation --- diff --git a/src/compiler.lisp b/src/compiler.lisp index eadbf39..49ea708 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -1478,8 +1478,8 @@ "return (typeof(" x ") == \"string\") && x.length == 1;"))) (define-builtin char-to-string (x) - (type-check (("x" "number" x)) - "String.fromCharCode(x)")) + (type-check (("x" "string" x)) + "(x)")) (define-builtin stringp (x) (js!bool (code "(typeof(" x ") == \"string\")"))) diff --git a/src/print.lisp b/src/print.lisp index 9db5354..79a5359 100644 --- a/src/print.lisp +++ b/src/print.lisp @@ -42,7 +42,9 @@ (#\newline "newline") (#\space "space") (otherwise (string form))))) - ((stringp form) (concat "\"" (escape-string form) "\"")) + ((stringp form) (if *print-escape* + (concat "\"" (escape-string form) "\"") + form)) ((functionp form) (let ((name (oget form "fname"))) (if name