Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: should also allow subclass Promise without Symbol.species #34533

Closed
wants to merge 1 commit into from

Conversation

JiaLiPassion
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #34162

This is a regression issue introduced by #34162, before that PR, we call this.constructor in Promise.then() to create a new Promise.
In the #34162 PR, ZoneAwarePromise support to subclass Promise by Symbol.species.
But we still need to support subclass without Symbol.species implemented.

What is the new behavior?

If the subclass doesn't have Symbol.species, we should use this.constructor instead of hardcoded ZoneAwarePromise.

Does this PR introduce a breaking change?

  • Yes
  • No

@JiaLiPassion JiaLiPassion requested a review from a team as a code owner December 22, 2019 04:18
@ngbot ngbot bot added this to the needsTriage milestone Dec 22, 2019
@JiaLiPassion JiaLiPassion added the target: patch This PR is targeted for the next patch release label Dec 22, 2019
@JiaLiPassion JiaLiPassion added the action: merge The PR is ready for merge by the caretaker label Jan 30, 2020
@AndrewKushnir AndrewKushnir added the action: presubmit The PR is in need of a google3 presubmit label Jan 30, 2020
@AndrewKushnir
Copy link
Contributor

Presubmit

@AndrewKushnir AndrewKushnir added the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Jan 30, 2020
@JiaLiPassion
Copy link
Contributor Author

@AndrewKushnir, thanks for the review, I have updated the PR.

@JiaLiPassion JiaLiPassion removed the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Jan 31, 2020
packages/zone.js/test/common/Promise.spec.ts Outdated Show resolved Hide resolved
packages/zone.js/test/common/Promise.spec.ts Outdated Show resolved Hide resolved
packages/zone.js/test/common/Promise.spec.ts Outdated Show resolved Hide resolved
@mhevery
Copy link
Contributor

mhevery commented Jan 31, 2020

presubmit

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker action: presubmit The PR is in need of a google3 presubmit area: zones cla: yes target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants