From c66db8d84fc4a138b4478891354b37934f7a397a Mon Sep 17 00:00:00 2001 From: * <8> Date: Thu, 20 Jan 2022 16:59:09 +0800 Subject: [PATCH] Match-id-8d8e589bdbc4b167a6b0e61f1706aa51e83543e5 --- libs/horizon/src/dom/SelectionRangeHandler.ts | 3 ++- libs/horizon/src/external/ChildrenUtil.ts | 3 ++- libs/horizon/src/renderer/TreeBuilder.ts | 2 +- libs/horizon/src/renderer/render/LazyComponent.ts | 3 ++- libs/horizon/src/renderer/submit/LifeCycleHandler.ts | 4 +++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/libs/horizon/src/dom/SelectionRangeHandler.ts b/libs/horizon/src/dom/SelectionRangeHandler.ts index 8497984d..f5bde5bf 100644 --- a/libs/horizon/src/dom/SelectionRangeHandler.ts +++ b/libs/horizon/src/dom/SelectionRangeHandler.ts @@ -69,10 +69,11 @@ function isNodeContainsByTargetNode(targetNode, node) { return false; } -function isInDocument(dom): any | void { +function isInDocument(dom) { if (dom && dom.ownerDocument) { return isNodeContainsByTargetNode(dom.ownerDocument.documentElement, dom); } + return false; } // 判断一个标签是否有设置选择范围的能力 diff --git a/libs/horizon/src/external/ChildrenUtil.ts b/libs/horizon/src/external/ChildrenUtil.ts index 9b35623f..d46e217b 100644 --- a/libs/horizon/src/external/ChildrenUtil.ts +++ b/libs/horizon/src/external/ChildrenUtil.ts @@ -46,7 +46,8 @@ function mapChildrenToArray( throw new Error( 'Object is invalid as a Horizon child. ' ); - default: + + // No Default } } diff --git a/libs/horizon/src/renderer/TreeBuilder.ts b/libs/horizon/src/renderer/TreeBuilder.ts index 55edba61..0d3bfa9e 100644 --- a/libs/horizon/src/renderer/TreeBuilder.ts +++ b/libs/horizon/src/renderer/TreeBuilder.ts @@ -219,7 +219,7 @@ export function tryRenderRoot(treeRoot: VNode) { } // 发起更新 -export function launchUpdateFromVNode(vNode: VNode): void { +export function launchUpdateFromVNode(vNode: VNode) { // 检查循环调用 checkLoopingUpdateLimit(); diff --git a/libs/horizon/src/renderer/render/LazyComponent.ts b/libs/horizon/src/renderer/render/LazyComponent.ts index 99e35353..f3dcc954 100644 --- a/libs/horizon/src/renderer/render/LazyComponent.ts +++ b/libs/horizon/src/renderer/render/LazyComponent.ts @@ -30,7 +30,7 @@ function captureLazyComponent( processing, lazyComponent, shouldUpdate, -): any | void { +) { if (!processing.isCreated) { // 每次加载lazy都当作mount来处理 processing.isCreated = true; @@ -64,6 +64,7 @@ function captureLazyComponent( Component, '', ); + return null; } } diff --git a/libs/horizon/src/renderer/submit/LifeCycleHandler.ts b/libs/horizon/src/renderer/submit/LifeCycleHandler.ts index 3c303192..d2eafa4c 100644 --- a/libs/horizon/src/renderer/submit/LifeCycleHandler.ts +++ b/libs/horizon/src/renderer/submit/LifeCycleHandler.ts @@ -71,6 +71,7 @@ function callBeforeSubmitLifeCycles( const root = vNode.realNode; clearContainer(root.outerDom); } + // No Default } } @@ -137,7 +138,8 @@ function callAfterSubmitLifeCycles( } } } - //No Default + + // No Default } }