-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Declare optional parameters according to HTML standard #98
Conversation
According to https://html.spec.whatwg.org/multipage/webappapis.html#timers timeout and handles of setTimeout and friends are optional.
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Declare optional parameters according to HTML standard
declare function clearTimeout(timeoutId: any): void; | ||
declare function setTimeout(callback: any, ms: number, ...args: Array<any>): number; | ||
declare function setInterval(callback: any, ms: number, ...args: Array<any>): number; | ||
declare function clearInterval(intervalId?: number): void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think these arguments to the clear
functions should be optional?
From the HTML standard, it looks like the parameters of |
It's true, the parameter is defined as optional:
in which case However, I'd argue that 99% of the cases where no handle is passed, are errors. |
Wow, that's really strange. What's the expected behaviour if you call |
@Daniel15 : The spec says that the function does nothing if the handle is not found in the handle list (I guess the handle |
@fkling Well, that's silly. I don't see any actual use for having a default value for |
I am being hack and is it i open an account for u all to use my mobile as conterbution ?? |
According to
https://html.spec.whatwg.org/multipage/webappapis.html#timers timeout
and handles of setTimeout and friends are optional.