From 55a2bc483c35b5dc28b1260199ab8f36b4f8768e Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 26 Feb 2019 21:46:01 -0500 Subject: [PATCH] refactor: simplify conditional --- packages/runtime-core/src/componentState.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/runtime-core/src/componentState.ts b/packages/runtime-core/src/componentState.ts index 74beb5fe..fec671ea 100644 --- a/packages/runtime-core/src/componentState.ts +++ b/packages/runtime-core/src/componentState.ts @@ -23,10 +23,8 @@ export function extractInitializers( const props = instance.$props for (let i = 0; i < keys.length; i++) { const key = keys[i] - if (!isReservedKey(key)) { - if (!props.hasOwnProperty(key)) { - data[key] = (instance as any)[key] - } + if (!isReservedKey(key) && !props.hasOwnProperty(key)) { + data[key] = (instance as any)[key] } } return data