]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: simplify check
authorEvan You <yyx990803@gmail.com>
Sat, 2 Nov 2019 14:38:25 +0000 (10:38 -0400)
committerEvan You <yyx990803@gmail.com>
Sat, 2 Nov 2019 14:38:25 +0000 (10:38 -0400)
packages/runtime-core/src/suspense.ts
packages/runtime-core/src/vnode.ts

index a01d7b20524db0ffd6f3338bf3f557e52ed95331..1494d241caa58f996ceaa65188b891070f07dab3 100644 (file)
@@ -1,4 +1,4 @@
-import { VNode, normalizeVNode, VNodeChild, VNodeTypes } from './vnode'
+import { VNode, normalizeVNode, VNodeChild } from './vnode'
 import { ShapeFlags } from './shapeFlags'
 import { isFunction, isArray } from '@vue/shared'
 import { ComponentInternalInstance, handleSetupResult } from './component'
@@ -9,10 +9,6 @@ import { updateHOCHostEl } from './componentRenderUtils'
 import { handleError, ErrorCodes } from './errorHandling'
 import { pushWarningContext, popWarningContext } from './warning'
 
-export function isSuspenseType(type: VNodeTypes): type is typeof SuspenseImpl {
-  return (type as any).__isSuspense === true
-}
-
 export const SuspenseImpl = {
   __isSuspense: true,
   process(
index 1159e989506b0bf446fe0832c5024b8fd49173d5..1f6d904038b5646cf7f0be025f54a9581f7cbf98 100644 (file)
@@ -16,7 +16,7 @@ import { RawSlots } from './componentSlots'
 import { ShapeFlags } from './shapeFlags'
 import { isReactive, Ref } from '@vue/reactivity'
 import { AppContext } from './apiApp'
-import { SuspenseBoundary, isSuspenseType } from './suspense'
+import { SuspenseBoundary } from './suspense'
 import { DirectiveBinding } from './directives'
 import { SuspenseImpl } from './suspense'
 
@@ -209,7 +209,7 @@ export function createVNode(
   // encode the vnode type information into a bitmap
   const shapeFlag = isString(type)
     ? ShapeFlags.ELEMENT
-    : __FEATURE_SUSPENSE__ && isSuspenseType(type)
+    : __FEATURE_SUSPENSE__ && (type as any).__isSuspense === true
       ? ShapeFlags.SUSPENSE
       : isObject(type)
         ? ShapeFlags.STATEFUL_COMPONENT