Permalink
Browse files

* src/cljs/cljs/core.cljs: optimize type_satisfies

  • Loading branch information...
1 parent 653a26e commit 1179c8dcda1d27a492b774d1536da4b6f4f331df David Nolen committed May 6, 2012
Showing with 4 additions and 5 deletions.
  1. +4 −5 src/cljs/cljs/core.cljs
View
9 src/cljs/cljs/core.cljs
@@ -39,16 +39,15 @@
[x]
(js* "(~{x} != null && ~{x} !== false)"))
+(set! *unchecked-if* true)
(defn ^boolean type_satisfies_
"Internal - do not use!"
[p x]
(cond
- ;; check that x isn't a CLJS ctor
- (and (coercive-not= x nil)
- ^boolean (.-cljs$lang$type x)) false
(aget p (goog.typeOf x)) true
(aget p "_") true
:else false))
+(set! *unchecked-if* false)
(defn is_proto_
[x]
@@ -5580,13 +5579,13 @@ reduces them without incurring seq initialization"
(meta obj))
(concat ["^"] (pr-seq (meta obj) opts) [" "]))
(cond
- (satisfies? IPrintable obj) (-pr-seq obj opts)
-
;; handle CLJS ctors
(and (coercive-not= obj nil)
^boolean (.-cljs$lang$type obj))
(.cljs$lang$ctorPrSeq obj obj)
+ (satisfies? IPrintable obj) (-pr-seq obj opts)
+
:else (list "#<" (str obj) ">")))))
(defn- pr-sb [objs opts]

0 comments on commit 1179c8d

Please sign in to comment.