const keys = Object.keys(fallthroughAttrs)
const { shapeFlag } = root
if (keys.length) {
- if (
- shapeFlag & ShapeFlags.ELEMENT ||
- shapeFlag & ShapeFlags.COMPONENT
- ) {
+ if (shapeFlag & (ShapeFlags.ELEMENT | ShapeFlags.COMPONENT)) {
if (propsOptions && keys.some(isModelListener)) {
// If a v-model listener (onUpdate:xxx) has a corresponding declared
// prop, it indicates this component expects to handle v-model and
__COMPAT__ &&
isCompatEnabled(DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE, instance) &&
vnode.shapeFlag & ShapeFlags.STATEFUL_COMPONENT &&
- (root.shapeFlag & ShapeFlags.ELEMENT ||
- root.shapeFlag & ShapeFlags.COMPONENT)
+ root.shapeFlag & (ShapeFlags.ELEMENT | ShapeFlags.COMPONENT)
) {
const { class: cls, style } = vnode.props || {}
if (cls || style) {
const isElementRoot = (vnode: VNode) => {
return (
- vnode.shapeFlag & ShapeFlags.COMPONENT ||
- vnode.shapeFlag & ShapeFlags.ELEMENT ||
+ vnode.shapeFlag & (ShapeFlags.COMPONENT | ShapeFlags.ELEMENT) ||
vnode.type === Comment // potential v-if branch switch
)
}
if (
forcePatchValue ||
!optimized ||
- patchFlag & PatchFlags.FULL_PROPS ||
- patchFlag & PatchFlags.HYDRATE_EVENTS
+ patchFlag & (PatchFlags.FULL_PROPS | PatchFlags.HYDRATE_EVENTS)
) {
for (const key in props) {
if (
// which also requires the correct parent container
!isSameVNodeType(oldVNode, newVNode) ||
// - In the case of a component, it could contain anything.
- oldVNode.shapeFlag & ShapeFlags.COMPONENT ||
- oldVNode.shapeFlag & ShapeFlags.TELEPORT)
+ oldVNode.shapeFlag & (ShapeFlags.COMPONENT | ShapeFlags.TELEPORT))
? hostParentNode(oldVNode.el)!
: // In other cases, the parent container is not actually used so we
// just pass the block element here to avoid a DOM parentNode call.
)
} else if (
(type === Fragment &&
- (patchFlag & PatchFlags.KEYED_FRAGMENT ||
- patchFlag & PatchFlags.UNKEYED_FRAGMENT)) ||
+ patchFlag &
+ (PatchFlags.KEYED_FRAGMENT | PatchFlags.UNKEYED_FRAGMENT)) ||
(!optimized && shapeFlag & ShapeFlags.ARRAY_CHILDREN)
) {
unmountChildren(children as VNode[], parentComponent, parentSuspense)
} 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) {