Neal Ehardt
Neal Ehardt

Reputation: 10954

Print the current stack trace in ClojureScript?

I'm debugging a ClojureScript program and I want to know where this function is called from, but I don't want to interrupt its execution. I already have source maps working. How do I print the current stack trace to console?

Upvotes: 3

Views: 873

Answers (1)

Neal Ehardt
Neal Ehardt

Reputation: 10954

Use the JavaScript Console API.

(.trace js/console)

In most browsers, it gives nice traces with source file links.

clojure.stacktrace/print-stack-trace is undefined in CLJS.

Upvotes: 4

Related Questions