cljs-dev

ClojureScript compiler & std lib dev, https://clojurescript.org/community/dev
dnolen 2020-08-07T00:04:11.018Z

@mfikes I'm actually surprised it ever worked - since setTimeout isn't a generally available thing

dnolen 2020-08-07T00:04:28.018500Z

I think we should probably modify that test to only run if it's present since I believe it's a hard requirement?

mfikes 2020-08-07T00:05:17.019300Z

Ahh, yeah... that seems like a decent argument... it is depending on something not guaranteed.

mfikes 2020-08-07T00:05:35.019800Z

To be honest, I tried to find what setTimeout is supposed to return... it is hard to find a real spec.

dnolen 2020-08-07T00:07:18.020600Z

hrm I also surprised that exists? doesn't treat undefined and null as equivalent

dnolen 2020-08-07T00:07:33.020900Z

it really should since you can't use it otherwise

dnolen 2020-08-07T00:07:48.021300Z

it's not a map test thing, it's for checking for the presence of globals

dnolen 2020-08-07T00:11:07.022Z

hrm my reading says exists? should work for undefined

dnolen 2020-08-07T00:17:56.022400Z

I left a comment (on the issue)

thheller 2020-08-07T08:14:53.023300Z

@mfikes setTimeout is supposed to return a number identifying the timeout which you may then use via clearTimeout(theNum) to cancel it. not sure if number is actually part of a spec but any kind of opaque value would do the same job, just not undefined 😛

mfikes 2020-08-07T11:47:42.025800Z

Right... if you look at what Node does, it doesn't return a number. But given that, I went to see if I can find a spec that says that the result will be not undefined, and found it challenging. I suspect that this JSC build may have setTimeout (unless David's comments above regarding exists? lead to something), but that its implementation is botched.

dnolen 2020-08-07T11:58:27.026500Z

@mfikes oh I think I misunderstood that detail - that setTimeout exists but that doesn't return the usual value

mfikes 2020-08-07T11:59:09.027200Z

Yeah... my last comment in the ticket was only about distinguishing whether it is returning null or undefined.

plexus 2020-08-07T14:51:15.027400Z

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

plexus 2020-08-07T14:52:30.028400Z

^ ticket for

(ns foo.bar
         (:require-macros [foo.baz :refer [macro-that-expands-to-require]]))
       (macro-that-expands-to-require)
including a working patch. The patch will presumably not pass mustard but consider it a starting point for further conversation on how to best solve this.

mfikes 2020-08-07T15:01:48.029700Z

@plexus One thought: There is a cljs.macro-test namespace that might be suitable for adding a test to (and if done, that will also ensure that things work for self-hosted)