fix(animations): validate against trigger() names that use @ symbols (#20326)

PR Close #20326
This commit is contained in:
Matias Niemelä
2017-11-10 09:46:18 +02:00
committed by Miško Hevery
parent 7c44637fbf
commit 1861e416a1
2 changed files with 13 additions and 0 deletions

View File

@ -90,6 +90,11 @@ export class AnimationAstBuilderVisitor implements AnimationDslVisitor {
let depCount = context.depCount = 0;
const states: StateAst[] = [];
const transitions: TransitionAst[] = [];
if (metadata.name.charAt(0) == '@') {
context.errors.push(
'animation triggers cannot be prefixed with an `@` sign (e.g. trigger(\'@foo\', [...]))');
}
metadata.definitions.forEach(def => {
this._resetContextStyleTimingState(context);
if (def.type == AnimationMetadataType.State) {