     (println (:value ret))
     (when-let [st (:stacktrace ret)]
       (if (and (true? (:source-map opts))
-               (vector? st))
-        (print-mapped-stacktrace st opts)
+               (satisfies? IParseStacktrace repl-env))
+        (print-mapped-stacktrace
+          (-parse-stacktrace repl-env st opts) opts)
         (println st))
       (flush))))
 

            [cljs.closure :as cljsc]
            [cljs.source-map :as sm])
  (:import [java.io File PushbackReader]
           [javax.xml.bind DatatypeConverter]))

(def ^:dynamic *cljs-verbose* false)

(defn print-mapped-stacktrace
  "Given a vector representing the canonicalized JavaScript stacktrace
   print the ClojureScript stacktrace. The canonical stacktrace must be
   in the form:

    [{:file <string>
      :function <string>
      :line <integer>
      :column <integer>}*]

   :file must be a URL path (without protocol) relative to :output-dir."
  ([stacktrace] (print-mapped-stacktrace stacktrace nil))
  ([stacktrace opts]
    (let [read-source-map' (memoize read-source-map)
          ns-info' (memoize ns-info)]
      (doseq [{:keys [function file line column] :as frame} stacktrace]
        ;; need to convert file, a relative URL style path, to host-specific file
        (let [file (io/file (URL. (.toURL (io/file (util/output-directory opts))) file))
              [sm {:keys [ns source-file] :as ns-info}]
              ((juxt read-source-map' ns-info') file)
              [line' column'] (if ns-info
                                (mapped-line-and-column sm line column)
                                [line column])
