File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 128
128
(when-some [variadic (.-cljs$core$IFn$_invoke$arity$variadic f)]
129
129
(set! (.-cljs$core$IFn$_invoke$arity$variadic ret)
130
130
(fn [& args]
131
- (apply variadic args)))))
131
+ (if *instrument-enabled*
132
+ (with-instrument-disabled
133
+ (conform!* args)
134
+ (binding [*instrument-enabled* true ]
135
+ (apply' variadic args)))
136
+ (apply' variadic args))))))
132
137
ret))
133
138
134
139
(defn- no-fspec
Original file line number Diff line number Diff line change 441
441
(is (= (s/describe #(odd? %)) ::s/unknown ))
442
442
(is (= (s/form #(odd? %)) ::s/unknown )))
443
443
444
+ (defn defk [key & [doc]]
445
+ key )
446
+
447
+ (s/fdef defk
448
+ :args (s/cat :key keyword?
449
+ :doc (s/? string?)))
450
+
451
+ (st/instrument `defk)
452
+
453
+ (deftest cljs-2977-variadic-fn
454
+ (is (thrown? js/Error (defk 1 1 )))
455
+ (is (thrown? js/Error (defk :foo 1 )))
456
+ (is (= :foo (defk :foo " bar" ))))
457
+
444
458
(comment
445
459
446
460
(run-tests )
You can’t perform that action at this time.
0 commit comments