File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 1136
1136
(not ('#{any clj clj-or-nil clj-nil number string boolean function object array js} tag))
1137
1137
(when-let [ps (:protocols (ana/resolve-existing-var env tag))]
1138
1138
(ps protocol)))))))
1139
+ first-arg-tag (ana/infer-tag env (first (:args expr)))
1139
1140
opt-not? (and (= (:name info) 'cljs.core/not)
1140
- (= (ana/infer-tag env (first (:args expr))) 'boolean))
1141
+ (= first-arg-tag 'boolean))
1142
+ opt-count? (and (= (:name info) 'cljs.core/count)
1143
+ (boolean ('#{string array} first-arg-tag)))
1141
1144
ns (:ns info)
1142
1145
js? (or (= ns 'js) (= ns 'Math))
1143
1146
goog? (when ns
1193
1196
opt-not?
1194
1197
(emits " (!(" (first args) " ))" )
1195
1198
1199
+ opt-count?
1200
+ (emits " ((" (first args) " ).length)" )
1201
+
1196
1202
proto?
1197
1203
(let [pimpl (str (munge (protocol-prefix protocol))
1198
1204
(munge (name (:name info))) " $arity$" (count args))]
Original file line number Diff line number Diff line change 1703
1703
(is (= " ab" (str " a" nil " b" )))
1704
1704
(is (= " ahellob" (str " a" (str-fn-2865 ) " b" ))))
1705
1705
1706
+ (deftest test-cljs-2886
1707
+ (is (zero? (count " " )))
1708
+ (is (== 1 (count " a" )))
1709
+ (is (zero? (count #js [])))
1710
+ (is (== 1 (count #js [1 ])))
1711
+ (is (zero? (count [])))
1712
+ (is (== 1 (count [1 ]))))
1713
+
1706
1714
(deftest test-cljs-2934
1707
1715
(let [x (delay 1 )]
1708
1716
(is (= " #object[cljs.core.Delay {:status :pending, :val nil}]" (pr-str x)))
You can’t perform that action at this time.
0 commit comments