mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
The animations package supports adding default parameter values to an animation that will be used as a fallback if some parameters aren't defined. The problem is that they're applied using a spread expression which means that any own property of the animation parameters will override the defaults, even if it resolves to null or undefined. This can lead to obscure errors like "Cannot read property toString of undefined" for an animation that looks like `{params: {foo: undefined}}` with defaults `{foo: 123}`.
I ran into this issue while debugging some test failures on Material.
These changes address the issue by:
1. Applying the defaults if the resolved value is null or undefined.
2. Updating the validation function to use a null check instead of `hasOwnProperty`.
PR Close #45339
|
||
|---|---|---|
| .. | ||
| animation_integration_spec.ts | ||
| animation_query_integration_spec.ts | ||
| animation_router_integration_spec.ts | ||
| animations_with_web_animations_integration_spec.ts | ||