From 1ed8fd7233ff08fe9da722648dc22efcb74920e8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Thu, 27 Jun 2013 02:49:33 +0200 Subject: [PATCH] Migrate CHARACTERP --- src/compiler.lisp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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)) -- 1.7.10.4