From: Evan You Date: Wed, 26 Sep 2018 22:39:47 +0000 (-0400) Subject: chore: masks X-Git-Tag: v3.0.0-alpha.0~1177 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1cc7734c24d299f34db252316dedc4f0eca91f33;p=thirdparty%2Fvuejs%2Fcore.git chore: masks --- diff --git a/packages/core/src/flags.ts b/packages/core/src/flags.ts index 3322e09fb9..787ca66a4b 100644 --- a/packages/core/src/flags.ts +++ b/packages/core/src/flags.ts @@ -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 }