Skip to content

Commit b33bde3

Browse files
iwilligswannodette
authored andcommitted
Allow the language_in && the language_out option to be set for the google closure compiler
1 parent 8419d8a commit b33bde3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/clj/cljs/closure.clj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
java.util.List
5050
com.google.common.collect.ImmutableList
5151
com.google.javascript.jscomp.CompilerOptions
52+
com.google.javascript.jscomp.CompilerOptions$LanguageMode
5253
com.google.javascript.jscomp.CompilationLevel
5354
com.google.javascript.jscomp.SourceMap$Format
5455
com.google.javascript.jscomp.SourceMap$DetailLevel
@@ -91,6 +92,19 @@
9192
[opts ^CompilerOptions compiler-options]
9293
(when (contains? opts :pretty-print)
9394
(set! (.prettyPrint compiler-options) (:pretty-print opts)))
95+
96+
(when (contains? opts :language-in)
97+
(case (:language-in opts)
98+
:ecmascript5 (.setLanguageIn compiler-options CompilerOptions$LanguageMode/ECMASCRIPT5)
99+
:ecmascript5-strict (.setLanguageIn compiler-options CompilerOptions$LanguageMode/ECMASCRIPT5_STRICT)
100+
:ecmascript3 (.setLanguageIn compiler-options CompilerOptions$LanguageMode/ECMASCRIPT3)))
101+
102+
(when (contains? opts :language-out)
103+
(case (:language-out opts)
104+
:ecmascript5 (.setLanguageOut compiler-options CompilerOptions$LanguageMode/ECMASCRIPT5)
105+
:ecmascript5-strict (.setLanguageOut compiler-options CompilerOptions$LanguageMode/ECMASCRIPT5_STRICT)
106+
:ecmascript3 (.setLanguageOut compiler-options CompilerOptions$LanguageMode/ECMASCRIPT3)))
107+
94108
(when (contains? opts :print-input-delimiter)
95109
(set! (.printInputDelimiter compiler-options)
96110
(:print-input-delimiter opts))))

0 commit comments

Comments
 (0)