Fork me on GitHub
#cljs-dev
<
2020-08-07
>
dnolen00:08:11

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

dnolen00:08:28

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

mfikes00:08:17

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

mfikes00:08:35

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

dnolen00:08:18

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

dnolen00:08:33

it really should since you can't use it otherwise

dnolen00:08:48

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

dnolen00:08:07

hrm my reading says exists? should work for undefined

dnolen00:08:56

I left a comment (on the issue)

thheller08:08:53

@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 😛

mfikes11:08:42

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.

dnolen11:08:27

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

mfikes11:08:09

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

plexus14:08:30

^ 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.

mfikes15:08:48

@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)