-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Specifically, improve proxying of native methods.
- Loading branch information
Showing
1 changed file
with
126 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56dfdd2
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.
Question:
In
no-setTimeout-if.js
andno-setInterval-if.js
why don't we justreturn
whendefuse==true
like we do inaddEventListener-defuser.js
instead of settingargs[0] = function(){};
? Right now the defused operation is wait and do nothing. I don't understand the point of waiting if we are going to do nothing i.e.function(){};
56dfdd2
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.
Caller expect a valid timer id as return value.
56dfdd2
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.
Just to make myself clear, I am suggesting changing
to
and you say this won't work.
56dfdd2
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.
https://developer.mozilla.org/en-US/docs/Web/API/setTimeout#return_value
56dfdd2
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.
got it. I didn't know setTimeout had a return value timeoutId.