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 1025
1025
1026
1026
(defmethod emit* :js
1027
1027
[{: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) " /*" )))
1030
1030
(emits code)
1031
1031
(emit-wrap env
1032
1032
(if code
Original file line number Diff line number Diff line change 40
40
unsafe-bit-and bit-shift-right-zero-fill mask bitpos caching-hash
41
41
defcurried rfn specify! js-this this-as implements? array js-obj
42
42
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 ])])
44
44
#? (:cljs (:require-macros [cljs.core :as core]))
45
45
(:require clojure.walk
46
46
clojure.set
866
866
(core/list 'js* " debugger;" ))
867
867
868
868
(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. "
871
871
[comment]
872
872
(core/let [[x & ys] (string/split comment #"\n " )]
873
873
(core/list 'js*
879
879
(reduce core/str " " ))
880
880
" */\n " ))))
881
881
882
+ (core/defmacro js-inline-comment
883
+ " Emit an inline JavaScript comment."
884
+ [comment]
885
+ (core/list 'js* (core/str " /**" comment " */" )))
886
+
882
887
(core/defmacro true? [x]
883
888
(bool-expr (core/list 'js* " ~{} === true" x)))
884
889
You can’t perform that action at this time.
0 commit comments