File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 299299 (apply f args)))
300300 (gobj/extend f))))
301301
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))))))))))
316314
317315(defn- no-fn-specs
318316 [v specs]
Original file line number Diff line number Diff line change 23752375 (if-not (nil? mac-var)
23762376 (#?@(:clj [binding [*ns* (create-ns *cljs-ns*)]]
23772377 :cljs [do ])
2378- (let [#?@ (:clj [mchk (some-> (find-ns 'clojure.spec)
2378+ (let [mchk #? (:clj (some-> (find-ns 'clojure.spec)
23792379 (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)))
23822384 form' (try
23832385 (apply @mac-var form env (rest form))
23842386 #?(:clj (catch ArityException e
You can’t perform that action at this time.
0 commit comments