Skip to content

Commit 1eecb03

Browse files
committed
Update to Java commit f40c9e5 (2021.12.10): TNS-57: support CLJS :require-macros
1 parent fcc1a5b commit 1eecb03

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

src/clojure/tools/namespace/parse.cljc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
(def ^:private ns-clause-head-names
112112
"Set of symbol/keyword names which can appear as the head of a
113113
clause in the ns form."
114-
#{"use" "require"})
114+
#{"use" "require" "require-macros"})
115115

116116
(def ^:private ns-clause-heads
117117
"Set of all symbols and keywords which can appear at the head of a

test/clojure/tools/namespace/parse_test.clj

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,22 @@
184184
deps-from-ns-decl)]
185185
(is (= #{'clojure.string} actual)))))
186186

187-
188-
(def ns-with-npm-dependency
187+
(def cljs-ns-with-npm-dependency
189188
"(ns com.examples.one
190189
(:require [\"foobar\"] [baz]))")
191190

192191
(deftest cljs-string-dependency
193-
(let [actual (-> ns-with-npm-dependency
192+
(let [actual (-> cljs-ns-with-npm-dependency
193+
str->ns-decl
194+
deps-from-ns-decl)]
195+
(is (= #{'baz} actual))))
196+
197+
(def cljs-ns-with-require-macros
198+
"(ns com.examples.one
199+
(:require-macros [org.macros :refer [my-macro]]))")
200+
201+
(deftest cljs-require-macros
202+
(let [actual (-> cljs-ns-with-require-macros
194203
str->ns-decl
195204
deps-from-ns-decl)]
196-
(is (= #{'baz} actual))))
205+
(is (= #{'org.macros} actual))))

0 commit comments

Comments
 (0)