We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 12be5ea commit 9510d0aCopy full SHA for 9510d0a
src/main/clojure/cljs/compiler.cljc
@@ -502,7 +502,18 @@
502
:cljs (gstring/startsWith t "{")) t
503
504
#?(:clj (.startsWith t "function")
505
- :cljs (gstring/startsWith t "function")) t
+ :cljs (gstring/startsWith t "function"))
506
+ (let [idx (.lastIndexOf t ":")
507
+ [fstr rstr] (if-not (== -1 idx)
508
+ [(subs t 0 idx) (subs t (inc idx) (count t))]
509
+ [t nil])
510
+ ret-t (when rstr (resolve-type env rstr))
511
+ axstr (subs fstr 9 (dec (count fstr)))
512
+ args-ts (when-not (string/blank? axstr)
513
+ (map (comp #(resolve-type env %) string/trim)
514
+ (string/split axstr #",")))]
515
+ (cond-> (str "function(" (string/join "," args-ts) ")")
516
+ ret-t (str ":" ret-t)))
517
518
#?(:clj (.endsWith t "=")
519
:cljs (gstring/endsWith t "="))
0 commit comments