Skip to content

Commit

Permalink
fix JS require in REPL when using symbol
Browse files Browse the repository at this point in the history
fixes #318
  • Loading branch information
thheller committed Jun 15, 2018
1 parent 0aee73b commit f3302f4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main/shadow/cljs/repl.clj
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,14 @@
:flags (:flags new-ns-info)}
(cond->
(= :shadow (get-in state [:js-options :js-provider]))
(assoc :js-requires (->> new-deps
(filter string?)
(map #(get-in state [:str->sym (:name new-ns-info) %]))
(into [])))))]
(assoc :js-requires
(->> new-deps
(map (fn [dep]
(or (and (string? dep) (get-in state [:str->sym (:name new-ns-info) dep]))
(and (contains? (:magic-syms state) dep) (get-in state [:ns-aliases dep]))
nil)))
(remove nil?)
(into [])))))]

(output/flush-sources state new-sources)

Expand Down

0 comments on commit f3302f4

Please sign in to comment.