Not sure if it's a bug or expected behaviour, but this:
(defn test-fn []
(let [href js/location.href
location "123"]
href))
gets compiled to this (not in advanced mode):
cognician.chat.ui.pages.insights.test_fn = (function cognician$chat$ui$pages$insights$test_fn(){
var href = location.href;
var location = "123";
return href;
});
and local {{location}} var shadows global I'm trying to access in {{location.href}}.
That sort of thing is expected and one should pay attention and work around stuff like this in JS, but in CLJS it's very confusing because nothing hints what am I doing wrong and why that code fails. I remember one of ClojureScript goals was to fix JS semantics, so maybe there's a way this might be addressed? At least throw a warning, maybe?