Fork me on GitHub
#clojurescript
<
2022-06-09
>
tianshu05:06:12

I'm not sure if it's an issue only for me. When I raise and js/Error, its error stack will be correctly displayed. So I have source map, I can see which line caused the error. But if I throw ex-info, the error will be displayed like this. Obviously, source map only work in this case.

tianshu05:06:14

My stupid, I should expand that arrow before "Uncaught"

jpmonettas13:06:30

hi everybody! is there a way of interning a var or just setting a global value like (set! js/a 42) but with a coming from a string? Something to accomplish the same as clojure (intern 'user (symbol "a") 42)

p-himik13:06:49

Interning - no. Setting a global variable - yes, just use goog.object/set on js/window.

jpmonettas13:06:22

thanks! that works

pez20:06:31

TIL.

(str/replace 'and #"a" "")
=> Execution error (TypeError) at (<cljs repl>:1).
   s.replace is not a function
While in Clojure:
(str/replace 'and #"a" "")
=> "nd"

Alex Miller (Clojure team)20:06:41

the doc string does not document that as a valid input so you are in undefined territory

🙏 1
Alex Miller (Clojure team)20:06:13

it's kind of an accident of implementation that it does

Alex Miller (Clojure team)20:06:32

so, I wouldn't recommend it

pez20:06:38

I'm porting a clj library to cljc. It's healthy also for the clj 😃