cljs.repl.browser/parse-stacktrace
multimethod | removed v1.7.10 | added v0.0-3053 | Edit |
(parse-stacktrace repl-env st err opts)
(defmulti parse-stacktrace (fn [repl-env st err opts] (:ua-product err)))
(defmethod parse-stacktrace :default
[repl-env st err opts] st)
(defmethod parse-stacktrace :chrome
[repl-env st err opts]
(->> st
string/split-lines
(drop-while #(.startsWith % "Error"))
(take-while #(not (.startsWith % " at eval")))
(map #(chrome-st-el->frame repl-env % opts))
(remove nil?)
vec))
(defmethod parse-stacktrace :safari
[repl-env st err opts]
(->> st
string/split-lines
(drop-while #(.startsWith % "Error"))
(take-while #(not (.startsWith % "eval code")))
(remove string/blank?)
(map #(safari-st-el->frame repl-env % opts))
(remove nil?)
vec))
(defmethod parse-stacktrace :firefox
[repl-env st err opts]
(->> st
string/split-lines
(drop-while #(.startsWith % "Error"))
(take-while #(= (.indexOf % "> eval") -1))
(remove string/blank?)
(map #(firefox-st-el->frame repl-env % opts))
(remove nil?)
vec))