refactor: merge bitwise flag checks (#4324)

This commit is contained in:
Hazlank
2021-08-16 14:13:04 -05:00
committed by GitHub
parent e936898abd
commit 6db15a27cf
4 changed files with 8 additions and 15 deletions

View File

@@ -730,7 +730,7 @@ export function normalizeChildren(vnode: VNode, children: unknown) {
} else if (isArray(children)) {
type = ShapeFlags.ARRAY_CHILDREN
} else if (typeof children === 'object') {
if (shapeFlag & ShapeFlags.ELEMENT || shapeFlag & ShapeFlags.TELEPORT) {
if (shapeFlag & (ShapeFlags.ELEMENT | ShapeFlags.TELEPORT)) {
// Normalize slot to plain children for plain element and Teleport
const slot = (children as any).default
if (slot) {