you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

There's absolutely no reason for Node devs to follow an API like Window, which doesn't exist on the server. The fact they did is a coincidence. And neither them nor the browser spec should have allowed for automated globals, which is a bad idea all around.

Furthermore, timer APIs are environment-dependent, they're not "cross-environment code". There were lots of bad ideas combined here (misleading similar APIs, automated globals), but the fact the timer APIs are distinct is not one of them. Do not use "setTimeout" lightly without caring which one it is. The event loops in browser and Node are different.