js-debugger

macrosince v0.0-2496Edit
(js-debugger)

Details:

Creates breakpoint that will stop the debugger if the browser's devtools are open. Equivalent to debugger; in JavaScript.


Examples:

(defn foo []
  (println "HI")
  (js-debugger)
  (println "WORLD"))

(foo)
;; will print "HI" then pause JS inside this function
;; if browser devtools are open.

Source docstring:
Emit JavaScript "debugger;" statement
Source code @ clojurescript:src/main/clojure/cljs/core.cljc
(core/defmacro js-debugger
  []
  (core/list 'do
             (core/list 'js* "debugger")
             nil))