From: David Vázquez Date: Thu, 27 Jun 2013 00:49:33 +0000 (+0200) Subject: Migrate CHARACTERP X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=1ed8fd7233ff08fe9da722648dc22efcb74920e8;p=jscl.git Migrate CHARACTERP --- diff --git a/src/compiler.lisp b/src/compiler.lisp index 98d90c1..a903fbd 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -1174,9 +1174,11 @@ (define-builtin characterp (x) (js!bool - (js!selfcall - "var x = " x ";" - "return (typeof(" x ") == \"string\") && (x.length == 1 || x.length == 2);"))) + (js!selfcall* + `(var (x ,x)) + `(return (and (== (typeof x) "string") + (or (== (get x "length") 1) + (== (get x "length") 2))))))) (define-builtin char-upcase (x) `(call |safe_char_upcase| ,x))