From eaa9fc379ace88b2a532ec2ca717109834410238 Mon Sep 17 00:00:00 2001 From: Yuichiro Yamashita Date: Sat, 31 Dec 2022 16:06:34 +0900 Subject: [PATCH] refactor --- src/compiler/compile/nodes/InlineComponent.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/compiler/compile/nodes/InlineComponent.ts b/src/compiler/compile/nodes/InlineComponent.ts index e7508f82fd..e9ac86a55c 100644 --- a/src/compiler/compile/nodes/InlineComponent.ts +++ b/src/compiler/compile/nodes/InlineComponent.ts @@ -143,10 +143,8 @@ export default class InlineComponent extends Node { children.push(slot_template); info.children.splice(i, 1); - } else if (child.type === 'Comment') { - if (children.length > 0) { - children[children.length - 1].children.unshift(child); - } + } else if (child.type === 'Comment' && children.length > 0) { + children[children.length - 1].children.unshift(child); } }