angular: clearInterval crashes zones in beta.11

[x] bug report

Either of these will crash zones

var timerId = 42; // anything that isn't actually a handle
clearInterval(timerId);
// Error: cannot read property 'cancelTask' of undefined

and try this

var timerId = setInterval(()=>{},1000);
clearInterval(timerId); // clears the first timer
clearInterval(timerId); // called twice ... boom!
// Uncaught Error: Task does not support cancellation, or is already canceled.

clearInterval is supposed to be safe in both cases`. It worked in beta.9

Here it is in a plunker: http://plnkr.co/edit/nyQIKU4JzTlwp5eOG7Qo?p=preview

Discovered while testing the docs “Cookbook Component Communication” sample. Here it is in the context of that cutdown sample: http://plnkr.co/edit/pYlQdKk6qLOGhQwSreoG?p=preview

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments