This repository was archived by the owner on Feb 26, 2024. It is now read-only.
feat(error): fix #975, can config how to load blacklist zone stack frames#1045
Merged
mhevery merged 1 commit intoangular:masterfrom Jun 24, 2018
Merged
feat(error): fix #975, can config how to load blacklist zone stack frames#1045mhevery merged 1 commit intoangular:masterfrom
mhevery merged 1 commit intoangular:masterfrom
Conversation
f28a215 to
3c34add
Compare
9d3cd3e to
d60fd0e
Compare
mhevery
previously approved these changes
Mar 14, 2018
Contributor
|
Could you resolve conflicts please? |
46b97ad to
85a6cb1
Compare
Collaborator
Author
|
@mhevery , I have resolved the conflict, the CI is red because |
85a6cb1 to
a50debd
Compare
Contributor
|
Sorry, more conflicts. |
Collaborator
Author
|
@mhevery , yes, the |
22af915 to
169e8c2
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 #975.
current
zone-errorprovide several functionality.handle
class MyError extends Error,new MyError() instanceof Errorwill reportfalseissue.remove
zone.js internal stack trace frames.add
zoneinformation to eachzone frame.The No2 and No3. feature will slow down the
new Error()performance,So the motivation of this PR is to provide a flag to let user be able to disable No2 and No3.
The flag is
__Zone_Error_BlacklistedStackFrames_policy. And the available options is:default: this is the default one, if you load
zone.js/dist/zone-errorwithoutsetting the flag,
defaultwill be used, andBlackListStackFrameswill be availablewhen
new Error(), you can get aerror.stackwhich iszone stack free. But thiswill slow down
new Error()a little bit.disable: this will disable
BlackListZoneStackFramefeature, and if you loadzone.js/dist/zone-error, you will only get awrapped Errorwhich can handleError inheritissue.lazy: this is a feature to let you be able to get
BlackListZoneStackFramefeature,but not impact performance. But as a trade off, you can't get the
zone free stack framesby accesserror.stack. You can only get it by accesserror.zoneAwareStack.