            (if (some (partial = ns-symbol) (known-namespaces))
              (handle-eval-success! opts
                                    cb
-                                   nil
-                                   #(swap! app-env assoc :current-ns ns-symbol))
+                                   #(swap! app-env assoc :current-ns ns-symbol)
+                                   nil)
              (let [ns-form `(~'ns ~ns-symbol)]
                (cljs/eval
                 st

        ns-form (make-ns-form kind specs target-ns)]
    (when (:verbose opts)
      (debug-prn "Processing " (name kind) " via ns: " (pr-str ns-form)))
    (cljs/eval
     st
     ns-form
     (make-base-eval-opts! opts)
     (partial handle-eval-result! opts cb #(when is-self-require?
                                             (swap! app-env assoc :current-ns restore-ns))))))

(defn process-doc
  [cb env sym]


(defn handle-eval-error!
  "Handles the case when the evaluation returned error, executing
  (side-effect!) *before* the callback is called with [false, error].
  Note that error is always the last parameter."
  ([opts cb error]
   (handle-eval-error! opts cb identity error))
  ([opts cb side-effect! error]
   (side-effect!)
   (set! *e error)
   (cb false error)))
