Skip to content

UMD version of Zone.js is incorrectly transpiled #59060

@clark-pan-canva

Description

@clark-pan-canva

Which @angular/* package(s) are the source of the bug?

zone.js

Is this a regression?

No

Description

The implementation of ZoneAwarePromise.allWithCallback uses a for(... of ...) loop. This is expected and correct, as Promise.all expects an iterable.

However, the latest published UMD version of zone.js transpiles that down to for (var _i = 0, values_3 = values; _i < values_3.length; _i++) {, which will only work with Arrays (or ArrayLike) values.

This fails when Promise.all is used with Iterables

Please provide a link to a minimal reproduction of the bug

JSFiddle showing bug when umd version of zone is installed

JSFiddle showing correct behaviour without zone.js

Please provide the exception or error you saw

N/A

Please provide the environment you discovered this bug in (run ng version)

N/A

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: packagingIssues related to Angular's creation of npm packagesarea: zonesIssues related to zone.js

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions