File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 251
251
(load-sources repl-env sources opts)
252
252
sources)))
253
253
254
+ (defn global-ns? [x]
255
+ (or (= 'js x)
256
+ (= " js" (namespace x))))
257
+
254
258
(defn- load-dependencies
255
259
" Compile and load the given `requires` and return the compiled sources."
256
260
([repl-env requires]
257
261
(load-dependencies repl-env requires nil ))
258
262
([repl-env requires opts]
259
- (doall (mapcat #(load-namespace repl-env % opts) (distinct requires)))))
263
+ (->> requires
264
+ distinct
265
+ (remove global-ns?)
266
+ (mapcat #(load-namespace repl-env % opts))
267
+ doall)))
260
268
261
269
(defn ^File js-src->cljs-src
262
270
" Map a JavaScript output file back to the original ClojureScript source
652
660
(defn- wrap-fn [form]
653
661
(cond
654
662
(and (seq? form)
655
- (#{'ns 'require 'require-macros
663
+ (#{'ns 'require 'require-macros 'refer-global
656
664
'use 'use-macros 'import 'refer-clojure} (first form)))
657
665
identity
658
666
673
681
(defn- init-wrap-fn [form]
674
682
(cond
675
683
(and (seq? form)
676
- (#{'ns 'require 'require-macros
684
+ (#{'ns 'require 'require-macros 'refer-global
677
685
'use 'use-macros 'import 'refer-clojure} (first form)))
678
686
identity
679
687
You can’t perform that action at this time.
0 commit comments