File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 619619 (let [m (munged-name expr)]
620620 m)))))]
621621 ; ; a reference to a dynamic var (earmuffed, not a local) reads the
622- ; ; box's .val. Cherry has real CLJS dynamic vars, no box.
622+ ; ; box's .val. Cherry too: its npm lib exports accessor boxes that
623+ ; ; proxy the real cljs.core vars.
623624 (emit-return (escape-jsx
624625 (cond-> expr
625- (and (not= :cherry (:target env))
626- (dynamic-name? orig-sym)
626+ (and (dynamic-name? orig-sym)
627627 (not (contains? (:var->ident env) orig-sym)))
628628 (str " .val" ))
629629 env)
802802 init (emit expr (expr-env env*))
803803 ; ; a dynamic var (earmuffed) compiles to a mutable box {value ...} so
804804 ; ; set!/binding can mutate it across ESM modules; references read .value.
805- ; ; Cherry has real CLJS dynamic vars, no box.
806- init (if (and (not= :cherry (:target env))
807- (dynamic-name? name))
805+ ; ; Cherry boxes user dynvars the same way.
806+ init (if (dynamic-name? name)
808807 (str " ({val: " init " })" )
809808 init)]
810809 (str " var " ident " = "
You can’t perform that action at this time.
0 commit comments