           (fn [fdecl]
             (core/let [arglist (first fdecl)
                   ;elide implicit macro args
-                  arglist (if (clojure.lang.Util/equals '&form (first arglist))
-                            (clojure.lang.RT/subvec arglist 2 (clojure.lang.RT/count arglist))
+                  arglist (if #?(:clj (clojure.lang.Util/equals '&form (first arglist))
+                                 :cljs (= '&form (first arglist)))
+                            #?(:clj (clojure.lang.RT/subvec arglist 2 (clojure.lang.RT/count arglist))
+                               :cljs (subvec arglist 2 (count arglist)))
                             arglist)
                   body (next fdecl)]
               (if (map? (first body))

                                 ifn (first inline)
                                 iname (second inline)]
                        ;; same as: (if (and (= 'fn ifn) (not (symbol? iname))) ...)
                        (if (if (clojure.lang.Util/equiv 'fn ifn)
                              (if (core/instance? clojure.lang.Symbol iname) false true))
                          ;; inserts the same fn name to the inline fn if it does not have one
                          (assoc m :inline (cons ifn (cons (clojure.lang.Symbol/intern (.concat (.getName ^clojure.lang.Symbol name) "__inliner"))
                                                       (next inline))))

        prefix (protocol-prefix p)
        _ (core/doseq [[mname & arities] methods]
            (when (some #{0} (map count (filter vector? arities)))
              (throw
                #?(:clj (Exception.
                          (core/str "Invalid protocol, " psym
                            " defines method " mname " with arity 0"))
                   :cljs (js/Error.
                           (core/str "Invalid protocol, " psym
                             " defines method " mname " with arity 0"))))))
        expand-sig (fn [fname slot sig]
                     `(~sig
                       (if (and ~(first sig) (. ~(first sig) ~(symbol (core/str "-" slot)))) ;; Property access needed here.
