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

fix(ngMock): return immediately from mock $interval.cancel() when no promise argument is supplied #6103

Closed
wants to merge 1 commit into from
Closed

fix(ngMock): return immediately from mock $interval.cancel() when no promise argument is supplied #6103

wants to merge 1 commit into from

Conversation

dluxemburg
Copy link
Contributor

This is a fix for a possible cause of issue #6099.

Calling $interval.cancel() without supplying the expected argument would cause a TypeError. There was a test for this but it was incomplete because it did not setup the instance of $interval with any repeated functions, so the function passed to forEach in which the error is thrown is never executed. The test failed when a repeated task was added.

This pull requests prevents the runtime exception by returning from cancel() immediately if no promise is supplied (doesn't even get to the loop) and improves the test by setting up a repeating task as the other tests do.

@mary-poppins
Copy link

I'm sorry, but I wasn't able to verify your Contributor License Agreement (CLA) signature. CLA signature is required for any code contributions to AngularJS.

Please sign our CLA and ensure that the CLA signature email address and the email address in this PR's commits match.

If you signed the CLA as a corporation, please let us know the company's name.

Thanks a bunch!

PS: If you signed the CLA in the past then most likely the email addresses don't match. Please sign the CLA again or update the email address in the commit of this PR.
PS2: If you are a Googler, please sign the CLA as well to simplify the CLA verification process.

@dluxemburg
Copy link
Contributor Author

Whoops sorry. Just did so.

@mary-poppins
Copy link

CLA signature verified! Thank you!

Someone from the team will now triage your PR and it will be processed based on the determined priority (doc updates and fixes with tests are prioritized over other changes).

@dluxemburg
Copy link
Contributor Author

Thanks! (Tag still says 'cla: no' though)

@mary-poppins
Copy link

CLA signature verified! Thank you!

Someone from the team will now triage your PR and it will be processed based on the determined priority (doc updates and fixes with tests are prioritized over other changes).

@tbosch tbosch self-assigned this Feb 5, 2014
@tbosch tbosch added this to the Backlog milestone Feb 5, 2014
@tbosch tbosch closed this in dd24c78 Feb 5, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants