-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
ZoneAwareError reads original stack despite setting __Zone_Error_ZoneJsInternalStackFrames_policy #43240
Labels
area: zones
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Milestone
Comments
arturovt
added a commit
to arturovt/angular
that referenced
this issue
Mar 25, 2022
…policy is used We don't have to read the `stack` property when the lazy stack frames policy is used. The V8 triggers the stack trace serialization only when the `stack` property is read for the first time within the `Accessors::ErrorStackGetter`. We want to avoid formatting the stack trace when the lazy policy is used, and we don't need the stack until the `zoneAwareStack` property is read. PR Close angular#43240
5 tasks
arturovt
added a commit
to arturovt/angular
that referenced
this issue
Mar 26, 2022
…policy is used We don't have to read the `stack` property when the lazy stack frames policy is used. The V8 triggers the stack trace serialization only when the `stack` property is read for the first time within the `Accessors::ErrorStackGetter`. We want to avoid formatting the stack trace when the lazy policy is used, and we don't need the stack until the `zoneAwareStack` property is read. PR Close angular#43240
arturovt
added a commit
to arturovt/angular
that referenced
this issue
Mar 26, 2022
…policy is used We don't have to read the `stack` property when the lazy stack frames policy is used. The V8 triggers the stack trace serialization only when the `stack` property is read for the first time within the `Accessors::ErrorStackGetter`. We want to avoid formatting the stack trace when the lazy policy is used, and we don't need the stack until the `zoneAwareStack` property is read. PR Close angular#43240
arturovt
added a commit
to arturovt/angular
that referenced
this issue
Mar 26, 2022
…policy is used We don't have to read the `stack` property when the lazy stack frames policy is used. The V8 triggers the stack trace serialization only when the `stack` property is read for the first time within the `Accessors::ErrorStackGetter`. We want to avoid formatting the stack trace when the lazy policy is used, and we don't need the stack until the `zoneAwareStack` property is read. PR Close angular#43240
arturovt
added a commit
to arturovt/angular
that referenced
this issue
Mar 26, 2022
…policy is used We don't have to read the `stack` property when the lazy stack frames policy is used. The V8 triggers the stack trace serialization only when the `stack` property is read for the first time within the `Accessors::ErrorStackGetter`. We want to avoid formatting the stack trace when the lazy policy is used, and we don't need the stack until the `zoneAwareStack` property is read. PR Close angular#43240
arturovt
added a commit
to arturovt/angular
that referenced
this issue
Mar 26, 2022
…policy is used We don't have to read the `stack` property when the lazy stack frames policy is used. The V8 triggers the stack trace serialization only when the `stack` property is read for the first time within the `Accessors::ErrorStackGetter`. We want to avoid formatting the stack trace when the lazy policy is used, and we don't need the stack until the `zoneAwareStack` property is read. PR Close angular#43240
arturovt
added a commit
to arturovt/angular
that referenced
this issue
Jun 18, 2022
…policy is used We don't have to read the `stack` property when the lazy stack frames policy is used. The V8 triggers the stack trace serialization only when the `stack` property is read for the first time within the `Accessors::ErrorStackGetter`. We want to avoid formatting the stack trace when the lazy policy is used, and we don't need the stack until the `zoneAwareStack` property is read. PR Close angular#43240
alxhub
added
the
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
label
Nov 16, 2022
arturovt
added a commit
to arturovt/angular
that referenced
this issue
Jun 14, 2023
…policy is used We don't have to read the `stack` property when the lazy stack frames policy is used. The V8 triggers the stack trace serialization only when the `stack` property is read for the first time within the `Accessors::ErrorStackGetter`. We want to avoid formatting the stack trace when the lazy policy is used, and we don't need the stack until the `zoneAwareStack` property is read. PR Close angular#43240
Good morning, any update on this matter? Thanks. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: zones
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Which @angular/* package(s) are relevant/releated to the feature request?
No response
Description
Zone.js's ZoneAwareError always stores the original error's stack in the constructor by accessing error.stack no matter what the __Zone_Error_ZoneJsInternalStackFrames_policy is.
angular/packages/zone.js/lib/common/error-rewrite.ts
Line 123 in a92a89b
This can lead to performance overhead in V8 when using custom stack traces because the prepareStackTrace method runs uneccesarily when constructing errors even if the error's stack will never be accessed.
In our project we use the source-map-support package that provides source map support for stack traces. This can be a costy operation first time (seconds), which we want to avoid when the error's stack is never accessed.
Proposed solution
If possible only access the original error's stack if it is necessary regarding the __Zone_Error_ZoneJsInternalStackFrames_policy.
Alternatives considered
.
The text was updated successfully, but these errors were encountered: