File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 172
172
{:require-foreign true
173
173
:output-dir " .cljs_rhino_repl"
174
174
:wrap wrap-fn})
175
+ repl /IParseStacktrace
176
+ (-parse-stacktrace [this frames-str ret {output-dir :output-dir }]
177
+ (vec
178
+ (map
179
+ (fn [frame-str]
180
+ (let [[file-side line-fn-side] (string/split frame-str #":" )
181
+ file (string/replace file-side #"\s +at\s +" " " )
182
+ [line function] (string/split line-fn-side #"\s +" )]
183
+ {:file (string/replace file (str output-dir File/separator) " " )
184
+ :function (when function
185
+ (-> function
186
+ (string/replace " (" " " )
187
+ (string/replace " )" " " )))
188
+ :line (when line
189
+ (Integer/parseInt line))
190
+ :column 0 }))
191
+ (string/split frames-str #"\n " ))))
175
192
repl /IJavaScriptEnv
176
193
(-setup [this opts]
177
194
(rhino-setup this opts))
195
212
196
213
(comment
197
214
215
+ (repl/-parse-stacktrace (repl-env )
216
+ " \t at .cljs_rhino_repl/goog/../cljs/core.js:4215 (seq)
217
+ \t at .cljs_rhino_repl/goog/../cljs/core.js:4245 (first)
218
+ \t at .cljs_rhino_repl/goog/../cljs/core.js:5295 (ffirst)
219
+ \t at <cljs repl>:1
220
+ \t at <cljs repl>:1"
221
+ nil
222
+ {:output-dir " .cljs_rhino_repl" })
223
+
198
224
(require '[cljs.repl :as repl])
199
225
(require '[cljs.repl.rhino :as rhino])
200
226
(def env (rhino/repl-env ))
You can’t perform that action at this time.
0 commit comments