File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8888 (some-> (.getRoot texpr) parse-texpr simplify-texpr))
8989
9090(defn params->method-params [xs]
91- (letfn [(not-opt? [x]
92- (not (string/starts-with? (name x) " opt_" )))]
93- (let [required (into [] (take-while not-opt? xs))
94- opts (drop-while not-opt? xs)]
95- (loop [ret [required] opts opts]
96- (if-let [opt (first opts)]
97- (recur (conj ret (conj (last ret) opt)) (drop 1 opts))
98- (seq ret))))))
91+ (let [not-opt? (complement :optional? )
92+ required (into [] (map :name (take-while not-opt? xs)))
93+ opts (map :name (drop-while not-opt? xs))]
94+ (loop [ret [required] opts opts]
95+ (if-let [opt (first opts)]
96+ (recur (conj ret (conj (last ret) opt)) (drop 1 opts))
97+ (seq ret)))))
9998
10099(defn generic? [t]
101100 (let [s (name t)]
136135 (if (or (.hasReturnType info)
137136 (as-> (.getParameterCount info) c
138137 (and c (pos? c))))
139- (let [arglist (into [] ( map symbol ( .getParameterNames info)) )
138+ (let [arglist (get-params info)
140139 arglists (params->method-params arglist)]
141140 {:tag 'Function
142141 :js-fn-var true
143142 :ret-tag (or (some-> (.getReturnType info)
144143 get-tag gtype->cljs-type)
145144 'clj-nil)
146- :variadic? (boolean (some '#{var_args} arglist))
147- :max-fixed-arity (count (take-while #( not= 'var_args % ) arglist))
145+ :variadic? (boolean (some :var-args? arglist))
146+ :max-fixed-arity (count (take-while ( complement :var-args? ) arglist))
148147 :method-params arglists
149148 :arglists arglists}))))
150149 {:file *source-file*
You can’t perform that action at this time.
0 commit comments