File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 10251025
10261026(defmethod emit* :js
10271027 [{:keys [op env code segs args]}]
1028- (if (and code #?(:clj (.startsWith ^String code " /*" )
1029- :cljs (gstring/startsWith code " /*" )))
1028+ (if (and code #?(:clj (.startsWith ^String ( string/trim code) " /*" )
1029+ :cljs (gstring/startsWith ( string/trim code) " /*" )))
10301030 (emits code)
10311031 (emit-wrap env
10321032 (if code
Original file line number Diff line number Diff line change 4040 unsafe-bit-and bit-shift-right-zero-fill mask bitpos caching-hash
4141 defcurried rfn specify! js-this this-as implements? array js-obj
4242 simple-benchmark gen-apply-to js-str es6-iterable load-file* undefined?
43- specify copy-arguments goog-define js-comment])])
43+ specify copy-arguments goog-define js-comment js-inline-comment ])])
4444 #? (:cljs (:require-macros [cljs.core :as core]))
4545 (:require clojure.walk
4646 clojure.set
866866 (core/list 'js* " debugger;" ))
867867
868868(core/defmacro js-comment
869- " Emit top-level JavaScript multi-line comment. New lines will create a
870- new comment line."
869+ " Emit a top-level JavaScript multi-line comment. New lines will create a
870+ new comment line. Comment block will be preceded and followed by a newline. "
871871 [comment]
872872 (core/let [[x & ys] (string/split comment #"\n " )]
873873 (core/list 'js*
879879 (reduce core/str " " ))
880880 " */\n " ))))
881881
882+ (core/defmacro js-inline-comment
883+ " Emit an inline JavaScript comment."
884+ [comment]
885+ (core/list 'js* (core/str " /**" comment " */" )))
886+
882887(core/defmacro true? [x]
883888 (bool-expr (core/list 'js* " ~{} === true" x)))
884889
You can’t perform that action at this time.
0 commit comments