From 3896ddb860e2a9c545c45c9a7e7c397e9d84139e Mon Sep 17 00:00:00 2001 From: daiwei Date: Tue, 13 Jun 2023 16:19:21 +0800 Subject: [PATCH] chore: improve code --- packages/compiler-sfc/src/script/resolveType.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/compiler-sfc/src/script/resolveType.ts b/packages/compiler-sfc/src/script/resolveType.ts index e9fd5299db8..b43bf79a68d 100644 --- a/packages/compiler-sfc/src/script/resolveType.ts +++ b/packages/compiler-sfc/src/script/resolveType.ts @@ -294,7 +294,7 @@ function mergeElements( } } if (calls) { - ;(res.calls || (res.calls = [])).push(...calls) + ;(res.calls ||= []).push(...calls) } } return res @@ -341,11 +341,7 @@ function resolveInterfaceMembers( } } if (calls) { - if (!base.calls) { - base.calls = calls - } else { - base.calls.push(...calls) - } + ;(base.calls ||= []).push(...calls) } } catch (e) { ctx.error(