Fork me on GitHub
#squint
<
2023-10-31
>
akond06:10:10

I am utilizing Squint to compile this expression:

(-> (js/$ "main")
	(.find "*:lt(20)")
	(.filter (fn [_ element]
				 (and
					 (not= "A" (.-nodeName element))
					 (-> (js/$ element) (.parents "a") .-length zero?)))))
the interesting bit beign:
var inject_links_BANG_ = (function () {
let text_elements1 = $("main").find("*:lt(20)").filter((function (_, element) {
let and__25548__auto__2 = ("A" !== element["nodeName"]);
if (and__25548__auto__2 != null && and__25548__auto__2 !== false) {
($(element).parents("a")["length"] == 0)} else { ; <--- NO RETURN STATEMENT
return and__25548__auto__2;}
}));
so this expression returns undefined when the first condition inside and is true, which is very weird.

borkdude07:10:16

Please submit an issue, I’ll have a look in an hour or two

borkdude09:10:54

@U4BHMMBB2 I'm looking at it now, but I don't understand the problem. Is it possible for you to write this down into a jquery-less example?

borkdude09:10:18

could also be an older version

borkdude10:10:18

found a repro

borkdude10:10:16

fixed in 0.3.36!

akond11:10:23

Sorry, I was out. This is great. Thank you.

🎉 1
borkdude18:10:58

The squint index.html page in the root of the repo now uses #C01GH5EN7JA clojure-mode, which was ported to squint and released to npm: https://squint-cljs.github.io/squint/ It uses both squint and clojure-mode directly from CDN via import-maps!

🚀 4