-
Notifications
You must be signed in to change notification settings - Fork 637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std/node: Node compatible setTimeout, setInterval #1622
Comments
I'm not sure how we can do that, it's the same problem as in #1455. I'm very much against overriding globals depending if we're in compat mode or Node, ie. we should stick to Deno's globals anyway. I discussed it with @dsherret, but there are no ideas how to reconcile the two, the globals are just incompatible. @bnoordhuis any ideas? |
But this difference actually prevents running mocha's integration test in compat mode as they use You can reproduce the above issue with the following commands.
How about overriding these in compat mode, but discouraging the use of these non-standard features somehow, for example, by warning in the linter |
I'd say it is probably safe to override them in compat mode, if |
Node also has |
The issue denoland/deno#12745 might be related if we want to implement |
Channeling @lucacasonato: idea is to monkey-patch setTimeout/setInterval globals and return objects instead of numbers in (My recollection was to return objects always but I might be misremembering and I don't have a strong preference anyway.) |
setTimeout in Node.js returns Timeout object
ref(Node.js):
We have
Timeout
class implemented in std/node, but doesn't seem implementing setTimeout correctlyThe text was updated successfully, but these errors were encountered: