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

clearInterval on a destroyed interval raises an exception #656

@alexi2014

Description

@alexi2014

The following piece of code raises "TypeError: Cannot read property 'length' of null" exception in Zone._updateTaskCount:

        this._interval1 = setInterval(() => {
            // clear interval for the first time
            clearInterval(this._interval1);
        }, 100);
        setTimeout(() => {
            // a bit later clear the destroyed interval - exception
            clearInterval(this._interval1);
        }, 200);

Here's a repro plunker - check console log after you open it:
https://plnkr.co/edit/S0haHUHmxrZHmRql2EjY?p=preview

As I understand, duplicate call to clearInterval on the same interval should not raise an exception (and doesn't do it with standard implementation in browsers).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions