Skip to content

Commit b25910d

Browse files
committed
CLJS-3349: Add :as-alias in alias map for self-hosted
1 parent 5e7fd72 commit b25910d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/main/cljs/cljs/js.cljs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@
186186

187187
(defn- alias-map
188188
[compiler cljs-ns]
189-
(->> (merge (get-in compiler [::ana/namespaces cljs-ns :requires])
190-
(get-in compiler [::ana/namespaces cljs-ns :require-macros]))
189+
(->> (env/with-compiler-env compiler
190+
(ana/get-aliases cljs-ns))
191191
(remove (fn [[k v]] (symbol-identical? k v)))
192192
(into {})))
193193

src/test/cljs/cljs/ns_test/foo.cljs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
;; You must not remove this notice, or any other, from this software.
88

99
(ns cljs.ns-test.foo
10-
(:require [cljs.test :refer-macros [deftest is]]))
10+
(:require [cljs.test :refer-macros [deftest is]]
11+
[made.up.lib :as-alias lib]))
1112

1213
(defn baz [] 123)
1314

@@ -17,3 +18,6 @@
1718
(deftest test-namespaced-keywords
1819
(is (= (str kw) ":cljs.ns-test.foo/foo"))
1920
(is (= (str qkw) ":cljs.ns-test.foo/foo")))
21+
22+
(deftest test-as-alias-keywords
23+
(is (keyword-identical? ::lib/foo :made.up.lib/foo)))

0 commit comments

Comments
 (0)