Skip to content

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

Closed
JiaLiPassion wants to merge 1 commit intoangular:masterfrom
JiaLiPassion:promise-subclass
Closed

fix: should also allow subclass Promise without Symbol.species#34533
JiaLiPassion wants to merge 1 commit intoangular:masterfrom
JiaLiPassion:promise-subclass

Conversation

@JiaLiPassion
Copy link
Copy Markdown
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 review from a team and mhevery December 22, 2019 04:18
@JiaLiPassion JiaLiPassion added the area: zones Issues related to zone.js label Dec 22, 2019
@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
Copy Markdown
Contributor

Presubmit

Comment thread packages/zone.js/test/common/Promise.spec.ts Outdated
Comment thread packages/zone.js/test/common/Promise.spec.ts Outdated
@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
Copy Markdown
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
Comment thread packages/zone.js/test/common/Promise.spec.ts Outdated
Comment thread packages/zone.js/test/common/Promise.spec.ts Outdated
Comment thread packages/zone.js/test/common/Promise.spec.ts Outdated
@mhevery
Copy link
Copy Markdown
Contributor

mhevery commented Jan 31, 2020

presubmit

@angular-automatic-lock-bot
Copy link
Copy Markdown

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 Issues related to zone.js 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.

5 participants