File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1365
1365
[& impls]
1366
1366
(core/let [t (with-meta
1367
1367
(gensym
1368
- (core/str " t_ "
1368
+ (core/str " t_reify_ "
1369
1369
(string/replace (core/str (munge ana/*cljs-ns*)) " ." " $" )))
1370
1370
{:anonymous true })
1371
1371
meta-sym (gensym " meta" )
1382
1382
IMeta
1383
1383
(~'-meta [~this-sym] ~meta-sym)
1384
1384
~@impls ))
1385
- (new ~t ~@locals ~(ana/elide-reader-meta (meta &form))))))
1385
+ (new ~t ~@locals
1386
+ ; ; if the form meta is empty, emit nil
1387
+ ~(let [form-meta (ana/elide-reader-meta (meta &form))]
1388
+ (when-not (empty? form-meta)
1389
+ form-meta))))))
1386
1390
1387
1391
(core/defmacro specify!
1388
1392
" Identical to reify but mutates its first argument."
1799
1803
(deftype* ~t ~fields ~pmasks
1800
1804
~(if (seq impls)
1801
1805
`(extend-type ~t ~@(dt->et t impls fields))))
1802
- (set! (.-getBasis ~t) (fn [] '[~@fields]))
1806
+ ; ; don't emit static basis method w/ reify
1807
+ ~@(when-not (.startsWith (name t) " t_reify" )
1808
+ [`(set! (.-getBasis ~t) (fn [] '[~@fields]))])
1803
1809
(set! (.-cljs$lang$type ~t) true )
1804
1810
(set! (.-cljs$lang$ctorStr ~t) ~(core/str r))
1805
1811
(set! (.-cljs$lang$ctorPrWriter ~t) (fn [this# writer# opt#] (-write writer# ~(core/str r))))
You can’t perform that action at this time.
0 commit comments