From 7bf09f0936dd1a490ebe4e407f7adc644d76c674 Mon Sep 17 00:00:00 2001 From: davidnolen Date: Wed, 20 Nov 2024 14:05:38 -0800 Subject: [PATCH] * :no-op only has :env & :op * test-no-op --- src/test/clojure/cljs/analyzer/spec_tests.clj | 6 +++++- src/test/clojure/cljs/analyzer/specs.cljc | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/test/clojure/cljs/analyzer/spec_tests.clj b/src/test/clojure/cljs/analyzer/spec_tests.clj index c24a1b458..82509afbd 100644 --- a/src/test/clojure/cljs/analyzer/spec_tests.clj +++ b/src/test/clojure/cljs/analyzer/spec_tests.clj @@ -208,7 +208,11 @@ (is (s/valid? ::a/node (no-warn (analyze ns-env '(String.))))) (is (s/valid? ::a/node (analyze ns-env '(js/String.))))) -;; no-op +(deftest test-no-op + (let [node (binding [ana/*unchecked-if* true] + (no-warn (analyze ns-env '(set! *unchecked-if* false))))] + (is (= :no-op (:op node))) + (is (s/valid? ::a/node node)))) (deftest test-ns (let [node (no-warn diff --git a/src/test/clojure/cljs/analyzer/specs.cljc b/src/test/clojure/cljs/analyzer/specs.cljc index 08e94910e..c721a0a3f 100644 --- a/src/test/clojure/cljs/analyzer/specs.cljc +++ b/src/test/clojure/cljs/analyzer/specs.cljc @@ -220,7 +220,8 @@ :req-un [::class ::args]))) (defmethod node :no-op [_] - ::base) + (s/keys + :req-un [::env ::op])) (defmethod node :ns [_] ::base)