clojurescript

dgr 2025-01-22T16:41:54.138279Z

(max 1 ##NaN) => ##NaN, as expected. But (max ##NaN 1) => 1. Bug?

p-himik 2025-01-22T16:46:00.445729Z

Personally, I'd treat it as GIGO. But seems that both clojure.core/max and js/Math.max treat NaN in a special way.

dgr 2025-01-22T16:46:40.928479Z

Yes. But also consistency. Order of arguments shouldn’t matter in this case.

dgr 2025-01-22T16:49:15.092579Z

Also, (min ##-Inf ##NaN ##Inf) => ##Inf, which is wrong in so many ways.

p-himik 2025-01-22T16:50:35.682179Z

If you treat it as GIGO, it all makes sense. :)

p-himik 2025-01-22T16:53:11.519809Z

But apparently it's actually well defined for both Java and JavaScript to return NaN for Math.max, so yeah, might make sense to be consistent.

dgr 2025-01-22T16:53:31.530799Z

Clojure JVM returns ##NaN for all these cases.

dgr 2025-01-22T16:53:52.101499Z

BTW, ClojureScript min suffers from all the same issues.

p-himik 2025-01-22T16:54:15.604349Z

There's enough differences between the platforms that relying just on Clojure's behavior makes little sense. The context is important. But not so much in this case, since the behavior is the same everywhere, and is explicitly defined.

dgr 2025-01-22T16:54:52.457319Z

Where are ClojureScript bugs filed?

p-himik 2025-01-22T16:57:29.209829Z

Same as for Clojure - http://ask.clojure.org. You can also mention it in #cljs-dev

👍 1
dnolen 2025-01-23T00:56:04.825399Z

Thanks for the report, will fix

👍 2
dnolen 2025-01-23T03:34:43.778099Z

https://clojure.atlassian.net/browse/CLJS-3425

Drew Verlee 2025-01-22T04:04:38.833749Z

missing source maps should never cause a problem for a browser client application right?

p-himik 2025-01-22T04:48:39.193579Z

Yes. Unless that app deliberately makes source maps its business for some reason.

👍 1
🙏 1
Drew Verlee 2025-01-22T05:56:26.282889Z

Thanks, yeah. Im realizing that there are several network calls resulting in 404, the missing source maps warning/error was one of many. im not sure why the prod app is asking for source maps, but it's a symptom, not a cause of the woes.

p-himik 2025-01-22T05:57:27.496879Z

The app itself probably doesn't ask for them. If you have the DevTools panel open, your browser itself will ask for source maps.

👍 1