Skip to content

zone.js Promise.finally behavior different from native #43206

Open

Description

@diyews

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

Don't known / other

Is this a regression?

No

Description

image

image

Sample code
  new Promise(res => {
     throw 'error';
     res(null);
  }).finally(() => console.log('finally'));

Minimal reproduction

zone.js: https://stackblitz.com/edit/zones-js-zdlcnc?file=index.ts
native: https://stackblitz.com/edit/js-iauprh

What happened in zone.js

zone.js .finally() scheduleResolveOrReject then clearRejectedNoCatch, which will remove the uncaught error

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/zones-js-zdlcnc?file=index.ts

Please provide the exception or error you saw

zone.js `.finally()` not throw the uncaught error while uncaught, but native promise will.

Please provide the environment you discovered this bug in

zone.js    v0.11.4

Anything else?

No response

Activity

  1. added this to the needsTriage milestone on Aug 19, 2021
  2. AndrewKushnir commented on Jun 22, 2022

    @AndrewKushnir
    Contributor

    Re-opening this issue, since the fix was reverted.

  3. added
    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
    P4A relatively minor issue that is not relevant to core functions
    on Jun 22, 2022
  4. modified the milestones: needsTriage, Backlog on Jun 22, 2022
  5. removed
    P4A relatively minor issue that is not relevant to core functions
    on Jun 22, 2022
  6. added a commit that references this issue on Jun 22, 2022
    a90573a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: zonesIssues related to zone.js

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions