Skip to content

Commit 2c516d4

Browse files
committed
CLJS-3223: get-js-index 0-arity should call get-js-index 1-arity
1 parent c00dee8 commit 2c516d4

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

src/main/clojure/cljs/analyzer/api.cljc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
(defn get-js-index
7171
"Return the currently computed Google Closure js dependency index from the
7272
compiler state."
73-
([] (get-options (current-state)))
73+
([] (get-js-index (current-state)))
7474
([state]
7575
(get @state :js-dependency-index)))
7676

src/test/clojure/cljs/analyzer_api_tests.clj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,15 @@
4040
(ana-api/analyze test-cenv test-env warning-form nil
4141
{:warning-handlers [(warning-handler counter)]}))
4242
(is (= 1 @counter))))
43+
44+
(deftest get-options-test
45+
(let [state (atom {:options {:a 1}})]
46+
(is (= {:a 1} (ana-api/get-options state)))
47+
(ana-api/with-state state
48+
(is (= {:a 1} (ana-api/get-options))))))
49+
50+
(deftest get-js-index-test
51+
(let [state (atom {:js-dependency-index {:a 1}})]
52+
(is (= {:a 1} (ana-api/get-js-index state)))
53+
(ana-api/with-state state
54+
(is (= {:a 1} (ana-api/get-js-index))))))

0 commit comments

Comments
 (0)