|
66 | 66 | "Given a browser file url convert it into a relative path that can be used
|
67 | 67 | to locate the original source."
|
68 | 68 | [{:keys [host host-port port] :as repl-env} file {:keys [asset-path] :as opts}]
|
69 |
| - (let [base-url-pattern (string->regex (str "http://" host ":" (or host-port port) "/"))] |
70 |
| - (if (re-find base-url-pattern file) |
| 69 | + (let [urlpat (if host |
| 70 | + (string->regex |
| 71 | + (str "http://" host ":" (or host-port port) "/")) |
| 72 | + "") |
| 73 | + match (if host |
| 74 | + (re-find urlpat file) |
| 75 | + (contains? opts :output-dir))] |
| 76 | + (if match |
71 | 77 | (-> file
|
72 |
| - (string/replace base-url-pattern "") |
| 78 | + (string/replace urlpat "") |
73 | 79 | (string/replace
|
74 | 80 | (string->regex
|
75 | 81 | ;; if :asset-path specified drop leading slash
|
|
166 | 172 | at goog.messaging.AbstractChannel.deliver (http://localhost:9000/out/goog/messaging/abstractchannel.js:142:13)"
|
167 | 173 | {:ua-product :chrome}
|
168 | 174 | nil)
|
| 175 | + |
| 176 | + ;; Node.js example |
| 177 | + (parse-stacktrace {} |
| 178 | + "Error: 1 is not ISeqable |
| 179 | + at Object.cljs$core$seq [as seq] (/home/my/cool/project/.cljs_bootstrap/cljs/core.js:3999:8) |
| 180 | + at Object.cljs$core$first [as first] (/home/my/cool/project/.cljs_bootstrap/cljs/core.js:4018:19) |
| 181 | + at cljs$core$ffirst (/home/my/cool/project/.cljs_bootstrap/cljs/core.js:5161:34) |
| 182 | + at /home/my/cool/project/.cljs_bootstrap/cljs/core.js:16006:88 |
| 183 | + at cljs.core.map.cljs$core$IFn$_invoke$arity$2 (/home/my/cool/project/.cljs_bootstrap/cljs/core.js:16007:3) |
| 184 | + at cljs.core.LazySeq.sval (/home/my/cool/project/.cljs_bootstrap/cljs/core.js:10244:109) |
| 185 | + at cljs.core.LazySeq.cljs$core$ISeqable$_seq$arity$1 (/home/my/cool/project/.cljs_bootstrap/cljs/core.js:10335:10) |
| 186 | + at Object.cljs$core$seq [as seq] (/home/my/cool/project/.cljs_bootstrap/cljs/core.js:3980:13) |
| 187 | + at Object.cljs$core$pr_sequential_writer [as pr_sequential_writer] (/home/my/cool/project/.cljs_bootstrap/cljs/core.js:28084:14) |
| 188 | + at cljs.core.LazySeq.cljs$core$IPrintWithWriter$_pr_writer$arity$3 (/home/my/cool/project/.cljs_bootstrap/cljs/core.js:28812:18)" |
| 189 | + {:ua-product :chrome} |
| 190 | + {:output-dir "/home/my/cool/project/.cljs_bootstrap"}) |
169 | 191 | )
|
170 | 192 |
|
171 | 193 | ;; -----------------------------------------------------------------------------
|
|
0 commit comments