squint

2025-01-10T01:33:36.294559Z

when using npx squint nrepl-server to evaluate code like

(ns eval)

(def a 1)
(println a)

(def b 2)
(println b)
everything below (println a) won't get executed.

2025-01-10T01:34:32.137699Z

log shows

request {:ns "eval", :file "/private/tmp/eval.cljs", :nrepl.middleware.print/print "cider.nrepl.pprint/pprint", :op "eval", :column 1, :line 1, :id "620a19ec-ef12-4c22-89c1-4958e979af3a", :code "(ns eval)\n\n(def a 1)\n(println a)\n\n(def b 2)\n(println b)", :nrepl.middleware.print/options {:associative 1, :length 500, :level 50, :right-margin 72}, :session "53c7fc54-e6e6-4172-bfb7-495005be64a3"}
:ns "eval"
About to eval:
(async function () {
var squint_core = await import('squint-cljs/core.js');
globalThis.eval = globalThis.eval || {};
globalThis.eval = globalThis.eval || {};
var a = 1;
globalThis.eval.a = a;
return squint_core.println(globalThis.eval.a);;
var b = 2;
globalThis.eval.b = b;
return squint_core.println(globalThis.eval.b);;
}) ()
not sure why when using squint in nrepl mode, many top level forms (with side effects i suppose?) got prepend with js returns

borkdude 2025-01-10T11:31:50.024439Z

seems like a bug, I'll take alook

👀 1
borkdude 2025-01-10T11:31:56.823369Z

can you file this as a github issue?

👍 1
borkdude 2025-01-10T11:32:07.357429Z

the global stuff is necessary for the REPL to work in an ES6 context

borkdude 2025-03-13T15:44:51.412429Z

This has been fixed

🎉 1
2025-03-13T23:06:09.516869Z

Thank you