File tree Expand file tree Collapse file tree 2 files changed +17
-17
lines changed Expand file tree Collapse file tree 2 files changed +17
-17
lines changed Original file line number Diff line number Diff line change 299
299
(apply f args)))
300
300
(gobj/extend f))))
301
301
302
- ; (defn- macroexpand-check
303
- ; [v args]
304
- ; (let [specs (fn-specs v)]
305
- ; (when-let [arg-spec (:args specs)]
306
- ; (when (= ::invalid (conform arg-spec args))
307
- ; (let [ed (assoc (explain-data* arg-spec [:args]
308
- ; (if-let [name (spec-name arg-spec)] [name] []) [] args)
309
- ; ::args args)]
310
- ; (throw (js/Error.
311
- ; (str
312
- ; "Call to " (->sym v) " did not conform to spec:\n"
313
- ; (with-out-str (explain-out ed))))))))))
314
-
315
-
302
+ (defn- macroexpand-check
303
+ [v args]
304
+ (let [specs (fn-specs v)]
305
+ (when-let [arg-spec (:args specs)]
306
+ (when (= ::invalid (conform arg-spec args))
307
+ (let [ed (assoc (explain-data* arg-spec [:args ]
308
+ (if-let [name (spec-name arg-spec)] [name] []) [] args)
309
+ ::args args)]
310
+ (throw (js/Error.
311
+ (str
312
+ " Call to " (->sym v) " did not conform to spec:\n "
313
+ (with-out-str (explain-out ed))))))))))
316
314
317
315
(defn- no-fn-specs
318
316
[v specs]
Original file line number Diff line number Diff line change 2375
2375
(if-not (nil? mac-var)
2376
2376
(#?@(:clj [binding [*ns* (create-ns *cljs-ns*)]]
2377
2377
:cljs [do ])
2378
- (let [#?@ (:clj [mchk (some-> (find-ns 'clojure.spec)
2378
+ (let [mchk #? (:clj (some-> (find-ns 'clojure.spec)
2379
2379
(ns-resolve 'macroexpand-check))
2380
- _ (when mchk
2381
- (mchk mac-var (next form)))])
2380
+ :cljs (and ^::no-resolve cljs.spec
2381
+ ^::no-resolve cljs.spec/macroexpand-check))
2382
+ _ (when mchk
2383
+ (mchk mac-var (next form)))
2382
2384
form' (try
2383
2385
(apply @mac-var form env (rest form))
2384
2386
#?(:clj (catch ArityException e
You can’t perform that action at this time.
0 commit comments