Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* src/clj/cljs/compiler.clj: comments about the various protocol keys…

…. add :protocol-impl :protocol-inline to the analysis environment when analyzing fn methods
  • Loading branch information...
commit 23b84bbddc78a1c9b2ec5bb4c6ea926003446cec 1 parent ce798d1
David Nolen authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/clj/cljs/compiler.clj
View
7 src/clj/cljs/compiler.clj
@@ -958,13 +958,17 @@
(when dynamic {:dynamic true})
(when-let [line (:line env)]
{:file *cljs-file* :line line})
+ ;; the protocol a protocol fn belongs to
(when protocol
{:protocol protocol})
+ ;; symbol for reified protocol
(when-let [protocol-symbol (-> sym meta :protocol-symbol)]
{:protocol-symbol protocol-symbol})
(when fn-var?
{:fn-var true
+ ;; protocol implementation context
:protocol-impl (:protocol-impl init-expr)
+ ;; inline protocol implementation context
:protocol-inline (:protocol-inline init-expr)
:variadic (:variadic init-expr)
:max-fixed-arity (:max-fixed-arity init-expr)
@@ -1021,6 +1025,9 @@
locals fields)
menv (if (> (count meths) 1) (assoc env :context :expr) env)
+ menv (merge menv
+ {:protocol-impl protocol-impl
+ :protocol-inline protocol-inline})
methods (map #(analyze-fn-method menv locals % gthis) meths)
max-fixed-arity (apply max (map :max-fixed-arity methods))
variadic (boolean (some :variadic methods))
Please sign in to comment.
Something went wrong with that request. Please try again.