@@ -383,144 +383,6 @@ goog.events.getProxy/f<@http://localhost:9000/out/goog/events/events.js:276:16"
383
383
nil )
384
384
)
385
385
386
- ; ; -----------------------------------------------------------------------------
387
- ; ; Rhino Stacktrace
388
-
389
- (defmethod parse-stacktrace :rhino
390
- [repl-env st err {:keys [output-dir] :as opts}]
391
- (letfn [(process-frame [frame-str]
392
- (when-not (or (string/blank? frame-str)
393
- (== -1 (.indexOf frame-str " \t at" )))
394
- (let [[file-side line-fn-side] (string/split frame-str #":" )
395
- file (string/replace file-side #"\s +at\s +" " " )
396
- [line function] (string/split line-fn-side #"\s +" )]
397
- {:file (string/replace file
398
- (str output-dir
399
- #?(:clj File/separator :cljs " /" ))
400
- " " )
401
- :function (when function
402
- (-> function
403
- (string/replace " (" " " )
404
- (string/replace " )" " " )))
405
- :line (when (and line (not (string/blank? line)))
406
- (parse-int line))
407
- :column 0 })))]
408
- (->> (string/split st #"\n " )
409
- (map process-frame)
410
- (remove nil?)
411
- vec)))
412
-
413
- (comment
414
- (parse-stacktrace {}
415
- " \t at .cljs_rhino_repl/goog/../cljs/core.js:4215 (seq)
416
- \t at .cljs_rhino_repl/goog/../cljs/core.js:4245 (first)
417
- \t at .cljs_rhino_repl/goog/../cljs/core.js:5295 (ffirst)
418
- \t at <cljs repl>:1
419
- \t at <cljs repl>:1"
420
- {:ua-product :rhino }
421
- {:output-dir " .cljs_rhino_repl" })
422
-
423
- (parse-stacktrace {}
424
- " org.mozilla.javascript.JavaScriptException: Error: 1 is not ISeqable (.cljs_rhino_repl/goog/../cljs/core.js#3998)
425
- \t at .cljs_rhino_repl/goog/../cljs/core.js:3998 (cljs$core$seq)
426
- \t at .cljs_rhino_repl/goog/../cljs/core.js:4017 (cljs$core$first)
427
- \t at .cljs_rhino_repl/goog/../cljs/core.js:5160 (cljs$core$ffirst)
428
- \t at .cljs_rhino_repl/goog/../cljs/core.js:16005
429
- \t at .cljs_rhino_repl/goog/../cljs/core.js:16004
430
- \t at .cljs_rhino_repl/goog/../cljs/core.js:10243
431
- \t at .cljs_rhino_repl/goog/../cljs/core.js:10334
432
- \t at .cljs_rhino_repl/goog/../cljs/core.js:3979 (cljs$core$seq)
433
- \t at .cljs_rhino_repl/goog/../cljs/core.js:28083 (cljs$core$pr_sequential_writer)
434
- \t at .cljs_rhino_repl/goog/../cljs/core.js:28811
435
- \t at .cljs_rhino_repl/goog/../cljs/core.js:28267 (cljs$core$pr_writer_impl)
436
- \t at .cljs_rhino_repl/goog/../cljs/core.js:28349 (cljs$core$pr_writer)
437
- \t at .cljs_rhino_repl/goog/../cljs/core.js:28353 (cljs$core$pr_seq_writer)
438
- \t at .cljs_rhino_repl/goog/../cljs/core.js:28416 (cljs$core$pr_sb_with_opts)
439
- \t at .cljs_rhino_repl/goog/../cljs/core.js:28430 (cljs$core$pr_str_with_opts)
440
- \t at .cljs_rhino_repl/goog/../cljs/core.js:28524
441
- \t at .cljs_rhino_repl/goog/../cljs/core.js:28520 (cljs$core$pr_str)
442
- at <cljs repl>:1
443
- "
444
- {:ua-product :rhino }
445
- {:output-dir " .cljs_rhino_repl" })
446
- )
447
-
448
- ; ; -----------------------------------------------------------------------------
449
- ; ; Nashorn Stacktrace
450
-
451
- (defmethod parse-stacktrace :nashorn
452
- [repl-env st err {:keys [output-dir] :as opts}]
453
- (letfn [(process-frame [frame-str]
454
- (when-not (or (string/blank? frame-str)
455
- (== -1 (.indexOf frame-str " \t at" )))
456
- (let [frame-str (string/replace frame-str #"\s +at\s +" " " )
457
- [function file-and-line] (string/split frame-str #"\s +" )
458
- [file-part line-part] (string/split file-and-line #":" )]
459
- {:file (string/replace (.substring file-part 1 )
460
- (str output-dir
461
- #?(:clj File/separator :cljs " /" ))
462
- " " )
463
- :function function
464
- :line (when (and line-part (not (string/blank? line-part)))
465
- (parse-int
466
- (.substring line-part 0
467
- (dec (count line-part)))))
468
- :column 0 })))]
469
- (->> (string/split st #"\n " )
470
- (map process-frame)
471
- (remove nil?)
472
- vec)))
473
-
474
- ; ; -----------------------------------------------------------------------------
475
- ; ; Graal.JS Stacktrace
476
-
477
- (defmethod parse-stacktrace :graaljs
478
- [repl-env st err {:keys [output-dir] :as opts}]
479
- (letfn [(process-frame [frame-str]
480
- (when-not (string/blank? frame-str)
481
- (let [[function file-and-line] (string/split frame-str #"\( " )
482
- [file-part line-part] (string/split file-and-line #":" )]
483
- {:file (string/replace file-part
484
- (str output-dir
485
- #?(:clj File/separator :cljs " /" ))
486
- " " )
487
- :function function
488
- :line (when (and line-part (not (string/blank? line-part)))
489
- (parse-int
490
- (.substring line-part 0
491
- (dec (count line-part)))))
492
- :column 0 })))]
493
- (->> (string/split st #"\n " )
494
- (map process-frame)
495
- (remove nil?)
496
- vec)))
497
-
498
- (comment
499
- (parse-stacktrace {}
500
- " Error: 1 is not ISeqable
501
- \t at cljs$core$seq (.cljs_nashorn_repl/goog/../cljs/core.js:3998)
502
- \t at cljs$core$first (.cljs_nashorn_repl/goog/../cljs/core.js:4017)
503
- \t at cljs$core$ffirst (.cljs_nashorn_repl/goog/../cljs/core.js:5160)
504
- \t at <anonymous> (.cljs_nashorn_repl/goog/../cljs/core.js:16005)
505
- \t at <anonymous> (.cljs_nashorn_repl/goog/../cljs/core.js:16004)
506
- \t at sval (.cljs_nashorn_repl/goog/../cljs/core.js:10243)
507
- \t at cljs$core$ISeqable$_seq$arity$1-6 (.cljs_nashorn_repl/goog/../cljs/core.js:10334)
508
- \t at cljs$core$seq (.cljs_nashorn_repl/goog/../cljs/core.js:3979)
509
- \t at cljs$core$pr_sequential_writer (.cljs_nashorn_repl/goog/../cljs/core.js:28083)
510
- \t at cljs$core$IPrintWithWriter$_pr_writer$arity$3-5 (.cljs_nashorn_repl/goog/../cljs/core.js:28811)
511
- \t at cljs$core$pr_writer_impl (.cljs_nashorn_repl/goog/../cljs/core.js:28267)
512
- \t at cljs$core$pr_writer (.cljs_nashorn_repl/goog/../cljs/core.js:28349)
513
- \t at cljs$core$pr_seq_writer (.cljs_nashorn_repl/goog/../cljs/core.js:28353)
514
- \t at cljs$core$pr_sb_with_opts (.cljs_nashorn_repl/goog/../cljs/core.js:28416)
515
- \t at cljs$core$pr_str_with_opts (.cljs_nashorn_repl/goog/../cljs/core.js:28430)
516
- \t at cljs$core$IFn$_invoke$arity$variadic-71 (.cljs_nashorn_repl/goog/../cljs/core.js:28524)
517
- \t at cljs$core$pr_str (.cljs_nashorn_repl/goog/../cljs/core.js:28520)
518
- \t at <anonymous> (<eval>:1)
519
- \t at <program> (<eval>:1)\n "
520
- {:ua-product :nashorn }
521
- {:output-dir " .cljs_nashorn_repl" })
522
- )
523
-
524
386
; ; -----------------------------------------------------------------------------
525
387
; ; Node.js Stacktrace
526
388
0 commit comments