File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 34833483 (contains? t 'js)
34843484 (some array-types t))))))
34853485
3486+ (defn- analyze-js-star-args [js-op env args]
3487+ (first (reduce
3488+ (fn [[argexprs env] arg]
3489+ [(conj argexprs (analyze env arg))
3490+ (if (= js-op 'cljs.core/and)
3491+ (set-test-induced-tags env arg)
3492+ env)])
3493+ [[] env]
3494+ args)))
3495+
34863496(defn analyze-js-star* [env jsform args form]
34873497 (let [enve (assoc env :context :expr )
3488- argexprs (vec (map #(analyze enve %) args))
34893498 form-meta (meta form)
34903499 segs (js-star-seg jsform)
34913500 tag (get-js-tag form)
34923501 js-op (:js-op form-meta)
3502+ argexprs (analyze-js-star-args js-op enve args)
34933503 numeric (:numeric form-meta)
34943504 validate (fn [warning-type valid-types?]
34953505 (let [types (map #(infer-tag env %) argexprs)]
Original file line number Diff line number Diff line change 874874 ([x] x)
875875 ([x & next]
876876 (core/let [forms (concat [x] next)]
877- (if (every? #(simple-test-expr? &env %)
878- (map #(cljs.analyzer/no-warn (cljs.analyzer/analyze &env %)) forms))
877+ (core/cond
878+ (every? #(simple-test-expr? &env %)
879+ (map #(cljs.analyzer/no-warn (cljs.analyzer/analyze &env %)) forms))
879880 (core/let [and-str (core/->> (repeat (count forms) " (~{})" )
880881 (interpose " && " )
881882 (#(concat [" (" ] % [" )" ]))
882883 (apply core/str))]
883884 (bool-expr `(~'js* ~and-str ~@forms)))
885+
886+ (typed-expr? &env x '#{boolean})
887+ `(if ~x (and ~@next) false )
888+
889+ :else
884890 `(let [and# ~x]
885891 (if and# (and ~@next) and#))))))
886892
You can’t perform that action at this time.
0 commit comments