   (fn [js-source]
     (throw (js/Error. "No *eval-fn* set"))))
 
-(defn js-eval [{:keys [source] :as resource}]
+(defn js-eval
+  "A default JavaScript evaluation function."
+  [{:keys [source] :as resource}]
   (js/eval source))
 
 (defn empty-state
+  "Construct an empty compiler state. Required to invoke analyze, compile,
+   eval and eval-str."
   ([]
    (env/default-compiler-env))
   ([init]

     {:*compiler*     state
      :*cljs-ns*      'cljs.user
      :*ns*           (create-ns ana/*cljs-ns*)
      :*data-readers* tags/*cljs-data-readers*}
     source name opts cb)))

;; -----------------------------------------------------------------------------

               (cb (.toString sb))))))))))

(defn compile
  "Compile ClojureScript source into JavaScript. The parameters:

   state (atom)
     the compiler state

   source (string)
     the ClojureScript source

   name (symbol)
     optional, the name of the source

   opts (map)
     compilation options.

     :load-fn    - library resolution function, see *load-fn*
     :source-map - set to true to generate inline source map information

   cb (function)
     callback, will be invoked with the compilation result (string)."
  ([state source cb]
   (compile state source nil cb))
  ([state source name cb]
