This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
Make the check for ZoneAwarePromise more stringent #495
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
Here is my proposed fix for #494. I've opted to check for the properties "__zone_symbol__state" and "__zone_symbol__value". It just occurred to me that checking the
constructor
might also work, but I am not sure. Commit message below.Thanks,
Mark
resolvePromise
assumes that if a value is aninstanceof
ZoneAwarePromise then it has the properties "__zone_symbol__state" and "__zone_symbol__value" and it is a true ZoneAwarePromise; however, a user can construct a value that breaks this assumption by inheriting from ZoneAwarePromise without actually having those properties or being a true ZoneAwarePromise (for example, by attempting to subclass Promise).We can fix this by adding checks for "__zone_symbol__state" and "__zone_symbol__value" to
resolvePromise
.