Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
CLJS-643: make the ClojureScript compiler (more) idempotent
* added cljs.env namespace, to hold any state shared among the different parts of the compiler (analyzer, compiler, closure) * added dynamic cljs.env/*compiler* to hold "compiler environment" map * cljs.closure/compiled-cljs => (:cljs.closure/compiled-cljs @*compiler-env*) * cljs.compiler/compiled-cljs => (:cljs.compiler/compiled-cljs *compiler-env*) * Namespaces: * cljs.analyzer/namespaces => (:cljs.analyzer/namespaces @*compiler-env*) * cljs.analyzer/namespaces is now an IDeref impl that delegates lookups to the current *compiler-env* * Constants: * eliminated analyzer/*track-constants*; now _always_ tracking constants (too cheap to bother with the analyzer complication), only question is whether we emit or not. This is now available @ (get-in @*compiler-env* [:opts :emit-constants]) * cljs.analzyer/constants-table => (:cljs.analyzer/constants-table *@compiler-env*) * make cljs.analyzer/constant-counter private * REPLs * allow REPL environments to carry their own compiler environment, defaulting to an empty one if not found * the browser repl always carries a compiler environment due to its multi-threaded precompilation
- Loading branch information
1 parent
2a8ab45
commit bc3bfae
Showing
7 changed files
with
273 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.