You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
without `zone-error` patch, the example above will output `false`, with the patch, the reuslt will be `true`.
92
+
93
+
2. BlacklistZoneStackFrames: remove zone.js stack from `stackTrace`, and add `zone` information. Without this patch, a lot of `zone.js` invocation stack will be shown
94
+
in stack frames.
95
+
96
+
```
97
+
at zone.run (polyfill.bundle.js: 3424)
98
+
at zoneDelegate.invokeTask (polyfill.bundle.js: 3424)
99
+
at zoneDelegate.runTask (polyfill.bundle.js: 3424)
100
+
at zone.drainMicroTaskQueue (polyfill.bundle.js: 3424)
101
+
at a.b.c (vendor.bundle.js: 12345 <angular>)
102
+
at d.e.f (main.bundle.js: 23456)
103
+
```
104
+
105
+
with this patch, those zone frames will be removed,
106
+
and the zone information `<angular>/<root>` will be added
107
+
108
+
```
109
+
at a.b.c (vendor.bundle.js: 12345 <angular>)
110
+
at d.e.f (main.bundle.js: 23456 <root>)
111
+
```
112
+
113
+
The second feature will slow down the `Error` performance, so `zone.js` provide a flag to let you be able to control the behavior.
114
+
The flag is `__Zone_Error_BlacklistedStackFrames_policy`. And the available options is:
115
+
116
+
1. default: this is the default one, if you load `zone.js/dist/zone-error` without
117
+
setting the flag, `default` will be used, and `BlackListStackFrames` will be available
118
+
when `new Error()`, you can get a `error.stack` which is `zone stack free`. But this
119
+
will slow down `new Error()` a little bit.
120
+
121
+
2. disable: this will disable `BlackListZoneStackFrame` feature, and if you load
122
+
`zone.js/dist/zone-error`, you will only get a `wrapped Error` which can handle
123
+
`Error inherit` issue.
124
+
125
+
3. lazy: this is a feature to let you be able to get `BlackListZoneStackFrame` feature,
126
+
but not impact performance. But as a trade off, you can't get the `zone free stack
127
+
frames` by access `error.stack`. You can only get it by access `error.zoneAwareStack`.
128
+
129
+
79
130
- Angular(2+)
80
131
81
132
Angular uses zone.js to manage async operations and decide when to perform change detection. Thus, in Angular,
0 commit comments