Skip to content

Commit 0ffe3d8

Browse files
symfrogswannodette
authored andcommitted
CLJS-2771: Elide "use strict" from final output
Narrow regular expression (requirejs/r.js#786)
1 parent 215cd3c commit 0ffe3d8

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/main/clojure/cljs/closure.clj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,10 +1591,7 @@
15911591

15921592
(defn elide-strict [js {:keys [elide-strict] :as opts}]
15931593
(cond-> js
1594-
(not (false? elide-strict))
1595-
(->
1596-
(string/replace "\"use strict\"" " ")
1597-
(string/replace "'use strict'" " "))))
1594+
(not (false? elide-strict)) (string/replace #"(?m)^['\"]use strict['\"]" " ")))
15981595

15991596
(defn output-one-file [{:keys [output-to] :as opts} js]
16001597
(let [js (elide-strict js opts)]

0 commit comments

Comments
 (0)