Skip to content

Commit 3cf960b

Browse files
author
dnolen
committed
CLJS-2241: Multiple requires of Node.js modules in non :nodejs target are not idempotent at the REPL
leave a comment about module subtlely, drop unneeded analyze
1 parent 1d16bc5 commit 3cf960b

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/main/clojure/cljs/repl.cljc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@
464464
(let [ijs (ana/parse-ns [form])] ;; if ns form need to check for js modules - David
465465
(cljsc/handle-js-modules opts [ijs] env/*compiler*)
466466
(binding [ana/*check-alias-dupes* false]
467-
(ana/no-warn (->ast form)))))
467+
(ana/no-warn (->ast form))))) ;; need new AST after we know what the modules are - David
468468
wrap-js
469469
;; TODO: check opts as well - David
470470
(if (:source-map repl-env)
@@ -493,11 +493,9 @@
493493
;; NOTE: means macros which expand to ns aren't supported for now
494494
;; when eval'ing individual forms at the REPL - David
495495
(when (#{:ns :ns*} (:op ast))
496-
(let [ast (ana/no-warn (ana/analyze env form nil opts))]
497-
(load-dependencies repl-env
498-
(into (vals (:requires ast))
499-
(distinct (vals (:uses ast))))
500-
opts)))
496+
(load-dependencies repl-env
497+
(into (vals (:requires ast)) (distinct (vals (:uses ast))))
498+
opts))
501499
(when *cljs-verbose*
502500
(err-out (println wrap-js)))
503501
(let [ret (-evaluate repl-env filename (:line (meta form)) wrap-js)]

0 commit comments

Comments
 (0)