Skip to content

Commit b74538b

Browse files
cemerickswannodette
authored andcommitted
CLJS-2345: escape paths emitted as args to cljs.core.load_file
1 parent f88fa62 commit b74538b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/main/clojure/cljs/compiler.cljc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,10 +1114,14 @@
11141114
(if (= :nodejs target)
11151115
;; under node.js we load foreign libs globally
11161116
(let [ijs (get js-dependency-index (name lib))]
1117-
(emitln "cljs.core.load_file(\""
1118-
(str (io/file (util/output-directory options) (or (deps/-relative-path ijs)
1119-
(util/relative-name (:url ijs)))))
1120-
"\");"))
1117+
(emitln "cljs.core.load_file("
1118+
(-> (io/file (util/output-directory options)
1119+
(or (deps/-relative-path ijs)
1120+
(util/relative-name (:url ijs))))
1121+
str
1122+
escape-string
1123+
wrap-in-double-quotes)
1124+
");"))
11211125
(emitln "goog.require('" (munge lib) "');")))]
11221126
:cljs
11231127
[(and (ana/foreign-dep? lib)

0 commit comments

Comments
 (0)