File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -4244,7 +4244,8 @@ reduces them without incurring seq initialization"
42444244 (if (instance? Atom a)
42454245 (let [validate (.-validator a)]
42464246 (when-not (nil? validate)
4247- (assert (validate new-value) " Validator rejected reference state" ))
4247+ (when-not (validate new-value)
4248+ (throw (js/Error. " Validator rejected reference state" ))))
42484249 (let [old-value (.-state a)]
42494250 (set! (.-state a) new-value)
42504251 (when-not (nil? (.-watches a))
Original file line number Diff line number Diff line change 743743 (let [a (atom [1 ] :validator coll? :meta {:a 1 })]
744744 (testing " Testing atom validators"
745745 (is (= coll? (get-validator a)))
746+ (is (thrown? js/Error (reset! a 1 )))
746747 (is (= {:a 1 } (meta a)))
747748 (alter-meta! a assoc :b 2 )
748749 (is (= {:a 1 :b 2 } (meta a)))))
You can’t perform that action at this time.
0 commit comments