diff --git a/src/hyperfiddle/electric/impl/analyzer.clj b/src/hyperfiddle/electric/impl/analyzer.clj index 92b697409..ec5c8b724 100644 --- a/src/hyperfiddle/electric/impl/analyzer.clj +++ b/src/hyperfiddle/electric/impl/analyzer.clj @@ -12,7 +12,7 @@ (defn var-name [ast] (if-let [var (:var ast)] - (.toSymbol var) + (.toSymbol ^clojure.lang.Var var) (or (:name ast) (:form ast)))) diff --git a/src/hyperfiddle/electric/impl/runtime.cljc b/src/hyperfiddle/electric/impl/runtime.cljc index e87869763..972a683e3 100644 --- a/src/hyperfiddle/electric/impl/runtime.cljc +++ b/src/hyperfiddle/electric/impl/runtime.cljc @@ -911,6 +911,10 @@ (tests (remove-dep-nodes (ir/input [(ir/node 'x) (ir/output ir/nop)])) := (ir/input [(ir/output ir/nop)])) +(defn tag-sym [sym jvm-hint js-hint] + #?(:clj (when jvm-hint (vary-meta sym assoc :tag jvm-hint)) + :cljs (when js-hint (vary-meta sym assoc :tag js-hint)))) + (defn compile [prefix inst e] (let [nodes (find-nodes inst) inst (remove-dep-nodes inst) @@ -924,7 +928,7 @@ `(doto (object-array ~(count free)) ~@(eduction (map-indexed (fn [i f] (list `aset i (env f)))) free))) emit-exprs (fn [exprs] - (list `fn [frame vars (sym prefix 'env)] + (list `fn [frame vars (tag-sym (sym prefix 'env) "[Ljava.lang.Object;" nil)] (list `let (into [] (comp (map-indexed (fn [i expr] [(expr-at i) expr])) cat) (pop exprs)) (peek exprs))))