 
 (deftest test-js-negative-infinity
   (= (with-out-str
-       (c/emit
-         (a/analyze (assoc ns-env :context :expr) 'js/-Infinity)))
+       (comp/emit
+         (ana/analyze (assoc aenv :context :expr) 'js/-Infinity)))
      "-Infinity"))

        opt {:optimize-constants true}
        optmod {:optimize-constants true :elide-asserts false}]
    (with-redefs [util/*clojurescript-version* {:major 0 :minor 0 :qualifier 42}]
      (e/with-compiler-env (e/default-compiler-env)
        (.setLastModified dst (- (.lastModified src) 100))
        (is (c/requires-compilation? src dst opt))
        (c/compile-file src dst opt)
        (is (not (c/requires-compilation? src dst opt)))
        (is (c/requires-compilation? src dst optmod))
        (c/compile-file src dst optmod)
        (is (not (c/requires-compilation? src dst optmod)))))))

(deftest fn-scope-munge
  (is (= (c/munge
           (get-in
             (a/analyze ns-env
               '(defn foo []
                  (fn bar [])))
             [:init :name]))
         'cljs$user$foo))
  (is (= (c/munge
           (get-in
             (a/analyze ns-env
               '(defn foo []
                  (fn bar [])))
             [:init :children 0 :children 0 :name]))
          'cljs$user$foo_$_bar))
  (is (= (c/munge
           (get-in
             (a/analyze ns-env
               '(fn []
                  (fn console [])))
             [:children 0 :children 0 :name]))

(ns cljs.compiler-tests
  (:use clojure.test)
  (:require [cljs.analyzer :as ana]
            [cljs.compiler :as comp]
            [cljs.env :as env]
            [cljs.util :as util])
  (:import [java.io File]))

(def aenv (assoc-in (ana/empty-env) [:ns :name] 'cljs.user))
(def cenv (env/default-compiler-env))

(deftest should-recompile
  (let [src (File. "test/hello.cljs")
