CLJS-817: Warning on use of undeclared var when creating recursive definition
CLJS-817: Warning on use of undeclared var when creating recursive definition

An attempt to define a var, where the initializer refers to the var being defined, succeeds but with an "Use of undeclared Var" warning. This is the result confirm-var-exists being unable to locate a declaration of the var within @env/*compiler* when the init-expr of the def form is being analyzed (all from within defmethod parse 'def).

This patch eagerly dumps---but conditionally, only in the case that an init-expr exists---some of the var's info into @env/*compiler* so that it is available during the analysis needed to form init-expr. The info dumped in is a subset of the info that is dumped in at the end of parse 'def.

The appropriate subset is probably debatable. Empirically you can see that an empty map would suffice to satisfy confirm-var-exists. But this patch puts more of what is available into @env/*compiler* "in case" it might be needed during analysis of the init-expr, without trying to second-guess how the analysis will be done. But, some of the items that fall later in parse 'def are not included (some depend themselves on init-expr).

Also, the overall approach doesn't address the case if parse 'def throws while this partial data has been mutated into @env/*compiler*---it doesn't address exception safety and attempt to remove it.

mstang/clojurescript,mstang/clojurescript,mstang/clojurescript