chore: masks

This commit is contained in:
Evan You 2018-09-26 18:39:47 -04:00
parent ee50fb9723
commit 1cc7734c24

View File

@ -2,21 +2,23 @@
export const enum VNodeFlags {
ELEMENT_HTML = 1,
ELEMENT_SVG = 1 << 1,
ELEMENT = ELEMENT_HTML | ELEMENT_SVG,
COMPONENT_UNKNOWN = 1 << 2,
COMPONENT_STATEFUL_NORMAL = 1 << 3,
COMPONENT_STATEFUL_SHOULD_KEEP_ALIVE = 1 << 4,
COMPONENT_STATEFUL_KEPT_ALIVE = 1 << 5,
COMPONENT_STATEFUL = COMPONENT_STATEFUL_NORMAL |
COMPONENT_STATEFUL_SHOULD_KEEP_ALIVE |
COMPONENT_STATEFUL_KEPT_ALIVE,
COMPONENT_FUNCTIONAL = 1 << 6,
COMPONENT = COMPONENT_UNKNOWN | COMPONENT_STATEFUL | COMPONENT_FUNCTIONAL,
TEXT = 1 << 7,
FRAGMENT = 1 << 8,
PORTAL = 1 << 9
PORTAL = 1 << 9,
// masks (only use for bitwise checks, do not use equal checks or assign)
ELEMENT = ELEMENT_HTML | ELEMENT_SVG,
COMPONENT_STATEFUL = COMPONENT_STATEFUL_NORMAL |
COMPONENT_STATEFUL_SHOULD_KEEP_ALIVE |
COMPONENT_STATEFUL_KEPT_ALIVE,
COMPONENT = COMPONENT_UNKNOWN | COMPONENT_STATEFUL | COMPONENT_FUNCTIONAL
}
export const enum ChildrenFlags {
@ -27,6 +29,8 @@ export const enum ChildrenFlags {
NONE_KEYED_VNODES = 1 << 3,
STABLE_SLOTS = 1 << 4,
DYNAMIC_SLOTS = 1 << 5,
// masks
HAS_SLOTS = STABLE_SLOTS | DYNAMIC_SLOTS,
MULTIPLE_VNODES = KEYED_VNODES | NONE_KEYED_VNODES
}