Replies: 1 comment
-
You are right, this is another reason and it is probably more important than the one mentioned. I still think it's worth mentioning them both, will be happy to review a PR. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In the documentation, it states
I find the text misleading, becuase there is a much more important reason why
setTimeout
and friends shouldn't be in a library like goja: They are not part of the ECMAScript specificationBoth a browser and node.js have implementations that are similar, but not identical interface. In a browser, the returned handle is a
number
. In node.js, it's an instance of aTimeout
class.So that is the reason why they shouldn't exist, and they don't exist in v8 either. (I don't know how it is for SpiderMonkey)
The fact that there's another library for node.js behaviour is amazing, and absolutely the right way to go about this. I'd gladly provide a PR with a rewrite this part of the readme, if you think it makes sense.
Beta Was this translation helpful? Give feedback.
All reactions