Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow the language_in && the language_out option to be set for the go…

…ogle closure compiler
  • Loading branch information...
commit b33bde39fe838d367939b55b9dadb0480ea00a7c 1 parent 8419d8a
@iwillig iwillig authored swannodette committed
Showing with 14 additions and 0 deletions.
  1. +14 −0 src/clj/cljs/closure.clj
View
14 src/clj/cljs/closure.clj
@@ -49,6 +49,7 @@
java.util.List
com.google.common.collect.ImmutableList
com.google.javascript.jscomp.CompilerOptions
+ com.google.javascript.jscomp.CompilerOptions$LanguageMode
com.google.javascript.jscomp.CompilationLevel
com.google.javascript.jscomp.SourceMap$Format
com.google.javascript.jscomp.SourceMap$DetailLevel
@@ -91,6 +92,19 @@
[opts ^CompilerOptions compiler-options]
(when (contains? opts :pretty-print)
(set! (.prettyPrint compiler-options) (:pretty-print opts)))
+
+ (when (contains? opts :language-in)
+ (case (:language-in opts)
+ :ecmascript5 (.setLanguageIn compiler-options CompilerOptions$LanguageMode/ECMASCRIPT5)
+ :ecmascript5-strict (.setLanguageIn compiler-options CompilerOptions$LanguageMode/ECMASCRIPT5_STRICT)
+ :ecmascript3 (.setLanguageIn compiler-options CompilerOptions$LanguageMode/ECMASCRIPT3)))
+
+ (when (contains? opts :language-out)
+ (case (:language-out opts)
+ :ecmascript5 (.setLanguageOut compiler-options CompilerOptions$LanguageMode/ECMASCRIPT5)
+ :ecmascript5-strict (.setLanguageOut compiler-options CompilerOptions$LanguageMode/ECMASCRIPT5_STRICT)
+ :ecmascript3 (.setLanguageOut compiler-options CompilerOptions$LanguageMode/ECMASCRIPT3)))
+
(when (contains? opts :print-input-delimiter)
(set! (.printInputDelimiter compiler-options)
(:print-input-delimiter opts))))
Please sign in to comment.
Something went wrong with that request. Please try again.