Skip to content

Commit

Permalink
CLJS-2659: Unable to require namespaces that require node modules in …
Browse files Browse the repository at this point in the history
…node cljs repl

handle-js-modules assumes it runs as an early pass over compiler inputs.
in the REPL of course this assumption is not true, so in order to
correctly update the compilation environment state to reflect known
Node dependencies we must get all transitive dependencies for the require
form and pass them to handle-js-modules
  • Loading branch information
swannodette committed Mar 15, 2018
1 parent 24845ec commit 8953f46
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/clojure/cljs/repl.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,11 @@
ast (->ast form)
ast (if-not (#{:ns :ns*} (:op ast))
ast
(let [ijs (ana/parse-ns [form])] ;; if ns form need to check for js modules - David
(cljsc/handle-js-modules opts [ijs] env/*compiler*)
(let [ijs (ana/parse-ns [form])]
(cljsc/handle-js-modules opts
(deps/dependency-order
(cljsc/add-dependency-sources [ijs] opts))
env/*compiler*)
(binding [ana/*check-alias-dupes* false]
(ana/no-warn (->ast form))))) ;; need new AST after we know what the modules are - David
wrap-js
Expand Down

0 comments on commit 8953f46

Please sign in to comment.