                                                       true)
                                  (= firstb :as) (pb ret (second bs) gvec)
                                  :else (if seen-rest?
-                                         (throw (new Exception "Unsupported binding form, only :as can follow & parameter"))
+                                         (throw
+                                           #?(:clj (new Exception "Unsupported binding form, only :as can follow & parameter")
+                                              :cljs (new js/Error "Unsupported binding form, only :as can follow & parameter")))
                                          (recur (pb ret firstb (core/list `nth gvec n nil))
                                                 (core/inc n)
                                                 (next bs)

                                 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))))

(defn- assoc-test [m test expr env]
  (if (contains? m test)
    (throw
      #?(:clj (clojure.core/IllegalArgumentException.
                (core/str "Duplicate case test constant '"
                  test "'"
                  (when (:line env)
                    (core/str " on line " (:line env) " "
                      cljs.analyzer/*cljs-file*))))
         :cljs (js/Error.
                 (core/str "Duplicate case test constant '"
                   test "'"
                   (when (:line env)
                     (core/str " on line " (:line env) " "
                       cljs.analyzer/*cljs-file*))))))
    (assoc m test expr)))

(defn- const? [env x]
