File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change 88
88
(some-> (.getRoot texpr) parse-texpr simplify-texpr))
89
89
90
90
(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)))))
99
98
100
99
(defn generic? [t]
101
100
(let [s (name t)]
136
135
(if (or (.hasReturnType info)
137
136
(as-> (.getParameterCount info) c
138
137
(and c (pos? c))))
139
- (let [arglist (into [] ( map symbol ( .getParameterNames info)) )
138
+ (let [arglist (get-params info)
140
139
arglists (params->method-params arglist)]
141
140
{:tag 'Function
142
141
:js-fn-var true
143
142
:ret-tag (or (some-> (.getReturnType info)
144
143
get-tag gtype->cljs-type)
145
144
'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))
148
147
:method-params arglists
149
148
:arglists arglists}))))
150
149
{:file *source-file*
You can’t perform that action at this time.
0 commit comments