From 0d206e2600a0116085d340157d968f2e1867a301 Mon Sep 17 00:00:00 2001 From: Tan Li Hau Date: Wed, 23 Sep 2020 09:47:08 +0800 Subject: [PATCH] remove copypaste animation validation from keyblock --- src/compiler/compile/nodes/KeyBlock.ts | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/compiler/compile/nodes/KeyBlock.ts b/src/compiler/compile/nodes/KeyBlock.ts index 906f9f7ce9..356210b6b0 100644 --- a/src/compiler/compile/nodes/KeyBlock.ts +++ b/src/compiler/compile/nodes/KeyBlock.ts @@ -1,35 +1,19 @@ import Expression from "./shared/Expression"; import map_children from "./shared/map_children"; import AbstractBlock from "./shared/AbstractBlock"; -import Element from "./Element"; export default class KeyBlock extends AbstractBlock { type: "KeyBlock"; expression: Expression; - has_animation: boolean; constructor(component, parent, scope, info) { super(component, parent, scope, info); this.expression = new Expression(component, this, scope, info.expression); - this.has_animation = false; - this.children = map_children(component, this, scope, info.children); - if (this.has_animation) { - if (this.children.length !== 1) { - const child = this.children.find( - (child) => !!(child as Element).animation - ); - component.error((child as Element).animation, { - code: `invalid-animation`, - message: `An element that use the animate directive must be the sole child of a key block` - }); - } - } - this.warn_if_empty_block(); } }