scittle 2026-10-05

Hey, I'm noticing that scittle doesn't seem to have the js-debugger primitive: https://cljs.github.io/api/cljs.core/js-debugger Here is an example app:

(ns debugger)

(js/console.log "Hello")
(js-debugger)
(js/console.log "World!")

<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Debug Test(Scittle)</title>
</head>
<body>
<h1>Example Crashy-Page</h1>

<script src="" type="text/javascript"></script>
<script type="application/x-scittle" src="debugger.cljs"></script>
</body>
</html>
Out of curiosity, is this intentional? And if so, how would you recommend starting up the debugger (ideally without just causing a crash. 😉 )

you can call (js/eval "debugger;") but I doubt that this will be useful in scittle, since the code runs in an interpreter and you'll mostly see interpreted frames

if you want this to be more useful, look at #C03U8L2NXNC which is a compiler

Okay, I had a hunch that might be the reason you didn't add it.

> if you want this to be more useful, look at #C03U8L2NXNC which is a compiler Thanks I'll give that a look too.

@borkdude I take it VMXXX are interpreted frames?

I think that's the JavaScript VM. Screenshot?

OOOH, actually you're right. It was just a single file with the line debugger;. Which probably came from the js/eval call. 🙂

Okay, I have another question (sorry about exploding the traffic on this channel, if there's somewhere else I should be asking things please redirect me 😉 ). Anyway, I'm just playing around with scittle and have the following program:

(ns debugger)

(def x {})
(defn foo [a]
  (fn []
    (.doesnotexist a)))

(js/console.log "Hello World")
(let [y (foo x)]
  (js/console.log (y)))
Note that I would expect this to print "Hello World", and then crash with some kind of error report. Which it does. But when it prints out the stack trace, I get:
debugger - debugger.cljs:10:19
debugger - debugger.cljs:10:3
debugger - debugger.cljs:9:1
Which surprised me as (.doesnotexist a) is on line 6. Am I doing something wrong here?

Thanks, the interpreter didn't record the location of the instance method call, I'll fix that when you can make an issue about it. This is a workaround where you do see the right location:

(ns debugger)

(def x {})
(defn foo [a]
  (fn []
    (identity (.doesnotexist a))))

(js/console.log "Hello World")
(let [y (foo x)]
  (js/console.log (y)))
Keep 'em coming!

❤️ 3

Always giving the best unpaid customer service in the open source world. You are a gem, @borkdude

💯 1

Absolute hard agree!

Well, I'm not unpaid, some people who are using my stuff hard enough are sponsoring me and they allow me to do this basically :)

❤️ 1

Still a gem.

❤️ 1
➕ 2