File tree 2 files changed +20
-1
lines changed 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -9242,7 +9242,9 @@ Maps become Objects. Arbitrary keys are encoded to by key->js."
9242
9242
(-prefer-method [mf dispatch-val dispatch-val-y])
9243
9243
(-get-method [mf dispatch-val])
9244
9244
(-methods [mf])
9245
- (-prefers [mf]))
9245
+ (-prefers [mf])
9246
+ (-default-dispatch-val [mf])
9247
+ (-dispatch-fn [mf]))
9246
9248
9247
9249
(defn- throw-no-method-error [name dispatch-val]
9248
9250
(throw (js/Error. (str " No method in multimethod '" name " ' for dispatch value: " dispatch-val))))
@@ -9424,6 +9426,8 @@ Maps become Objects. Arbitrary keys are encoded to by key->js."
9424
9426
9425
9427
(-methods [mf] @method-table)
9426
9428
(-prefers [mf] @prefer-table)
9429
+ (-default-dispatch-val [mf] default-dispatch-val )
9430
+ (-dispatch-fn [mf] dispatch-fn)
9427
9431
9428
9432
INamed
9429
9433
(-name [this] (-name name))
@@ -9461,6 +9465,14 @@ Maps become Objects. Arbitrary keys are encoded to by key->js."
9461
9465
" Given a multimethod, returns a map of preferred value -> set of other values"
9462
9466
[multifn] (-prefers multifn))
9463
9467
9468
+ (defn default-dispatch-val
9469
+ " Given a multimethod, return it's default-dispatch-val."
9470
+ [multifn] (-default-dispatch-val multifn))
9471
+
9472
+ (defn dispatch-fn
9473
+ " Given a multimethod, return it's dispatch-fn."
9474
+ [multifn] (-dispatch-fn multifn))
9475
+
9464
9476
; ; UUID
9465
9477
9466
9478
(deftype UUID [uuid]
Original file line number Diff line number Diff line change 2714
2714
(is (= 12345 (:baz m)))
2715
2715
(is (= " String Metadata" (:whatever m)))))
2716
2716
2717
+ (defmulti cljs-1144 identity :default ::default )
2718
+
2719
+ (deftest test-cljs-1144
2720
+ (is (not= map (dispatch-fn cljs-1144)))
2721
+ (is (= identity (dispatch-fn cljs-1144)))
2722
+ (is (= ::default (default-dispatch-val cljs-1144 ))))
2723
+
2717
2724
(comment
2718
2725
; ; ObjMap
2719
2726
; ; (let [ks (map (partial str "foo") (range 500))
You can’t perform that action at this time.
0 commit comments