|
260 | 260 | (vec |
261 | 261 | (for [{:keys [function file line column] :as frame} stacktrace] |
262 | 262 | ;; need to convert file, a relative URL style path, to host-specific file |
263 | | - (let [rfile (io/file (URL. (.toURL (io/file (util/output-directory opts))) file)) |
| 263 | + (let [no-source-file? (if-not file |
| 264 | + true |
| 265 | + (.startsWith file "<")) |
| 266 | + rfile (when-not no-source-file? |
| 267 | + (io/file (URL. (.toURL (io/file (util/output-directory opts))) file))) |
264 | 268 | [sm {:keys [ns source-file] :as ns-info}] |
265 | | - ((juxt read-source-map' ns-info') rfile) |
| 269 | + (when-not no-source-file? |
| 270 | + ((juxt read-source-map' ns-info') rfile)) |
266 | 271 | [line' column'] (if ns-info |
267 | 272 | (mapped-line-and-column sm line column) |
268 | 273 | [line column]) |
269 | 274 | name' (if (and ns-info function) |
270 | 275 | (symbol (name ns) (cljrepl/demunge function)) |
271 | 276 | function) |
272 | | - file' (string/replace |
273 | | - (.getCanonicalFile |
274 | | - (if ns-info |
275 | | - source-file |
276 | | - (io/file rfile))) |
277 | | - (str (System/getProperty "user.dir") File/separator) "") |
| 277 | + file' (if no-source-file? |
| 278 | + file |
| 279 | + (string/replace |
| 280 | + (.getCanonicalFile |
| 281 | + (if ns-info |
| 282 | + source-file |
| 283 | + (io/file rfile))) |
| 284 | + (str (System/getProperty "user.dir") File/separator) "")) |
278 | 285 | url (or (and ns-info (io/resource (util/ns->relpath ns))) |
279 | | - (io/resource file))] |
| 286 | + (and file (io/resource file)))] |
280 | 287 | (merge |
281 | 288 | {:function name' |
282 | | - :file (io/file file') |
283 | | - :line line' |
284 | | - :column column'} |
| 289 | + :file (if no-source-file? |
| 290 | + (str "NO_SOURCE_FILE" |
| 291 | + (when file |
| 292 | + (str " " file))) |
| 293 | + (io/file file')) |
| 294 | + :line line' |
| 295 | + :column column'} |
285 | 296 | (when url |
286 | 297 | {:url url})))))))) |
287 | 298 |
|
|
293 | 304 | (doseq [{:keys [function file line column]} |
294 | 305 | (mapped-stacktrace stacktrace opts)] |
295 | 306 | ((:print opts) "\t" |
296 | | - (str (and function (str function " ")) |
297 | | - "(" file ":" line ":" column ")"))))) |
| 307 | + (str (when function (str function " ")) |
| 308 | + "(" file (when line (str ":" line)) (when column (str ":" column)) ")"))))) |
298 | 309 |
|
299 | 310 | (comment |
300 | 311 | (cljsc/build "samples/hello/src" |
|
0 commit comments