Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

fix(setTimeout): allow clearTimeout to be called in setTimeout callback #301

Closed
wants to merge 1 commit into from

Conversation

frankwallis
Copy link
Contributor

This is a fix for #290 - "More tasks executed than were scheduled" error.

The change is to set task.cancelFn = null before invoking a task for non-periodic tasks. As it is no longer possible to cancel the task which is just about to be invoked, I think this should be ok. I also updated the setTimeout tests to create new zones to run the tests in, as initially the test was incorrectly passing due to the task counts not being 0 to begin with.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

1 similar comment
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@frankwallis
Copy link
Contributor Author

I have signed the CLA

@googlebot
Copy link

CLAs look good, thanks!

1 similar comment
@googlebot
Copy link

CLAs look good, thanks!

@mhevery mhevery closed this in a6967ad Apr 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants