fix(animations): treat numeric state name values as strings (#22923)
This patch ensures that if a numeric state name value in an animation is detected then it will not throw an error. Normally this wouldn't occur, but some JS optimizers may convert a quoted numeric value (like "1" to 1) in some cases to save space. This patch makes sure that Angular doesn't throw an error when this occurs. PR Close #22923
This commit is contained in:
@ -96,7 +96,7 @@ export class AnimationAstBuilderVisitor implements AnimationDslVisitor {
|
||||
if (def.type == AnimationMetadataType.State) {
|
||||
const stateDef = def as AnimationStateMetadata;
|
||||
const name = stateDef.name;
|
||||
name.split(/\s*,\s*/).forEach(n => {
|
||||
name.toString().split(/\s*,\s*/).forEach(n => {
|
||||
stateDef.name = n;
|
||||
states.push(this.visitState(stateDef, context));
|
||||
});
|
||||
|
Reference in New Issue
Block a user