File tree Expand file tree Collapse file tree 2 files changed +23
-7
lines changed Expand file tree Collapse file tree 2 files changed +23
-7
lines changed Original file line number Diff line number Diff line change @@ -3393,7 +3393,7 @@ reduces them without incurring seq initialization"
3393
3393
nsc)))
3394
3394
:default (garray/defaultCompare (.-name a) (.-name b))))
3395
3395
3396
- (deftype Keyword [ns name fqn ^:mutable _hash]
3396
+ (deftype Keyword [ns name ^string fqn ^:mutable _hash]
3397
3397
Object
3398
3398
(toString [_] (str " :" fqn))
3399
3399
(equiv [this other]
Original file line number Diff line number Diff line change 936
936
(core/list 'js* " debugger" )
937
937
nil ))
938
938
939
+ (core/defmacro js-doc
940
+ [comment]
941
+ (core/let [[x & ys] (string/split comment #"\n " )]
942
+ (core/list 'js*
943
+ (core/str
944
+ " /**\n "
945
+ (core/str " * " x " \n " )
946
+ (core/->> ys
947
+ (map #(core/str " * " (string/replace % #"^ " " " ) " \n " ))
948
+ (reduce core/str " " ))
949
+ " */" ))))
950
+
939
951
(core/defmacro js-comment
940
952
" Emit a top-level JavaScript multi-line comment. New lines will create a
941
953
new comment line. Comment block will be preceded and followed by a newline"
1485
1497
~@body))))
1486
1498
1487
1499
(core/defn- add-obj-methods [type type-sym sigs]
1488
- (map (core/fn [[f & meths :as form]]
1489
- (core/let [[f meths] (if (vector? (first meths))
1490
- [f [(rest form)]]
1491
- [f meths])]
1492
- `(set! ~(extend-prefix type-sym f)
1493
- ~(with-meta `(fn ~@(map #(adapt-obj-params type %) meths)) (meta form)))))
1500
+ (mapcat
1501
+ (core/fn [[f & meths :as form]]
1502
+ (core/let [[f meths] (if (vector? (first meths))
1503
+ [f [(rest form)]]
1504
+ [f meths])
1505
+ exp [`(set! ~(extend-prefix type-sym f)
1506
+ ~(with-meta `(fn ~@(map #(adapt-obj-params type %) meths)) (meta form)))]]
1507
+ (if (= f 'toString)
1508
+ (into [`(js-doc " @return {string}\n @override" )] exp)
1509
+ exp)))
1494
1510
sigs))
1495
1511
1496
1512
(core/defn- ifn-invoke-methods [type type-sym [f & meths :as form]]
You can’t perform that action at this time.
0 commit comments