2
2
EMPTY_OBJ ,
3
3
MODE_HYDRATE ,
4
4
MODE_SUSPENDED ,
5
- RESET_MODE
5
+ RESET_MODE ,
6
+ UNDEFINED
6
7
} from '../constants' ;
7
8
import { BaseComponent , getDomSibling } from '../component' ;
8
9
import { Fragment } from '../create-element' ;
@@ -47,7 +48,7 @@ export function diff(
47
48
48
49
// When passing through createElement it assigns the object
49
50
// constructor as undefined. This to prevent JSON-injection.
50
- if ( newVNode . constructor !== undefined ) return null ;
51
+ if ( newVNode . constructor !== UNDEFINED ) return null ;
51
52
52
53
// If the previous diff bailed out, resume creating/hydrating.
53
54
if ( oldVNode . _flags & MODE_SUSPENDED ) {
@@ -317,7 +318,7 @@ export function diff(
317
318
* @param {VNode } root
318
319
*/
319
320
export function commitRoot ( commitQueue , root , refQueue ) {
320
- root . _nextDom = undefined ;
321
+ root . _nextDom = UNDEFINED ;
321
322
322
323
for ( let i = 0 ; i < refQueue . length ; i ++ ) {
323
324
applyRef ( refQueue [ i ] , refQueue [ ++ i ] , refQueue [ ++ i ] ) ;
@@ -534,7 +535,7 @@ function diffElementNodes(
534
535
if ( nodeType === 'progress' && inputValue == null ) {
535
536
dom . removeAttribute ( 'value' ) ;
536
537
} else if (
537
- inputValue !== undefined &&
538
+ inputValue !== UNDEFINED &&
538
539
// #2756 For the <progress>-element the initial value is 0,
539
540
// despite the attribute not being present. When the attribute
540
541
// is missing the progress bar is treated as indeterminate.
@@ -550,7 +551,7 @@ function diffElementNodes(
550
551
}
551
552
552
553
i = 'checked' ;
553
- if ( checked !== undefined && checked !== dom [ i ] ) {
554
+ if ( checked !== UNDEFINED && checked !== dom [ i ] ) {
554
555
setProperty ( dom , i , checked , oldProps [ i ] , namespace ) ;
555
556
}
556
557
}
@@ -633,7 +634,7 @@ export function unmount(vnode, parentVNode, skipRemove) {
633
634
634
635
// Must be set to `undefined` to properly clean up `_nextDom`
635
636
// for which `null` is a valid value. See comment in `create-element.js`
636
- vnode . _component = vnode . _parent = vnode . _dom = vnode . _nextDom = undefined ;
637
+ vnode . _component = vnode . _parent = vnode . _dom = vnode . _nextDom = UNDEFINED ;
637
638
}
638
639
639
640
/** The `.render()` method for a PFC backing instance. */
0 commit comments