This repository was archived by the owner on Feb 26, 2024. It is now read-only.
fix #595, #427, #602, refactor ZoneAwareError property copy logic#597
Merged
mhevery merged 1 commit intoangular:masterfrom Jan 17, 2017
Merged
fix #595, #427, #602, refactor ZoneAwareError property copy logic#597mhevery merged 1 commit intoangular:masterfrom
mhevery merged 1 commit intoangular:masterfrom
Conversation
Collaborator
Author
1f3cdb5 to
3b05a99
Compare
|
Hi guys, |
d5d4f67 to
5c3362d
Compare
5c3362d to
d743324
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
fix #595,#427.
In previous PR to fix #546, we copy every property from NativeError to this (ZoneAwareError) with following logic.
and such logic will have conflict with following angular2 BaseError logic.
BaseError has such hack logic to make sure
thisis used.because BaseError's constructor will call super , and super will call copy, copy will then call
BaseError's setter, but this._nativeError is still undefined, so it will cause Exception.
In this PR, instead of copy property values with assignAll, I create propertyDescriptor to delegate to native error.
And because ZoneAwareError already handle Error
thisconstructor issue, maybe in the future, angular2 BaseError don't need to handle such issue again.angular/angular#13908