From 2ac875768e3010b4dcd22c8644ccb9202423ac1c Mon Sep 17 00:00:00 2001 From: henninggross Date: Tue, 12 Oct 2021 16:10:19 +0200 Subject: [PATCH] making use of newly created compiler error --- src/compiler/compile/nodes/Animation.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/compiler/compile/nodes/Animation.ts b/src/compiler/compile/nodes/Animation.ts index ac9dddd275..98239d3c2b 100644 --- a/src/compiler/compile/nodes/Animation.ts +++ b/src/compiler/compile/nodes/Animation.ts @@ -26,12 +26,17 @@ export default class Animation extends Node { } const block = parent.parent; - if (!block || block.type !== 'EachBlock' || !block.key) { + if (!block || block.type !== 'EachBlock') { // TODO can we relax the 'immediate child' rule? component.error(this, compiler_errors.invalid_animation_immediate); return; } + if (block && block.type === 'EachBlock' && !block.key) { + component.error(this, compiler_errors.invalid_animation_key); + return; + } + (block as EachBlock).has_animation = true; this.expression = info.expression