From 750248de7eba8d2df05a5c4e03bd1324924526b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matias=20Niemel=C3=A4?= Date: Fri, 1 Nov 2019 13:22:07 -0700 Subject: [PATCH 1/2] refactor(ivy): use hex flags instead of binary for TNodeFlags --- packages/core/src/render3/interfaces/node.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/core/src/render3/interfaces/node.ts b/packages/core/src/render3/interfaces/node.ts index 3fa02886e0684..052d19eaadbd2 100644 --- a/packages/core/src/render3/interfaces/node.ts +++ b/packages/core/src/render3/interfaces/node.ts @@ -46,37 +46,37 @@ export const enum TNodeType { */ export const enum TNodeFlags { /** This bit is set if the node is a host for any directive (including a component) */ - isDirectiveHost = 0b000000001, + isDirectiveHost = 0x1, /** * This bit is set if the node is a host for a component. Setting this bit implies that the * isDirectiveHost bit is set as well. */ - isComponentHost = 0b000000010, + isComponentHost = 0x2, /** This bit is set if the node has been projected */ - isProjected = 0b000000100, + isProjected = 0x4, /** This bit is set if any directive on this node has content queries */ - hasContentQuery = 0b000001000, + hasContentQuery = 0x8, /** This bit is set if the node has any "class" inputs */ - hasClassInput = 0b000010000, + hasClassInput = 0x10, /** This bit is set if the node has any "style" inputs */ - hasStyleInput = 0b000100000, + hasStyleInput = 0x20, /** This bit is set if the node has initial styling */ - hasInitialStyling = 0b001000000, + hasInitialStyling = 0x40, /** This bit is set if the node has been detached by i18n */ - isDetached = 0b010000000, + isDetached = 0x80, /** * This bit is set if the node has directives with host bindings. This flags allows us to guard * host-binding logic and invoke it only on nodes that actually have directives with host * bindings. */ - hasHostBindings = 0b100000000, + hasHostBindings = 0x100, } /** From 5badd9cb6ea3c79b84781e0ed637d129f2ec6ea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matias=20Niemel=C3=A4?= Date: Tue, 5 Nov 2019 14:38:30 -0800 Subject: [PATCH 2/2] fixup! refactor(ivy): use hex flags instead of binary for TNodeFlags --- packages/core/src/render3/interfaces/node.ts | 27 +++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/packages/core/src/render3/interfaces/node.ts b/packages/core/src/render3/interfaces/node.ts index 052d19eaadbd2..bc44f9ad70cbe 100644 --- a/packages/core/src/render3/interfaces/node.ts +++ b/packages/core/src/render3/interfaces/node.ts @@ -45,36 +45,39 @@ export const enum TNodeType { * Corresponds to the TNode.flags property. */ export const enum TNodeFlags { - /** This bit is set if the node is a host for any directive (including a component) */ + /** Bit #1 - This bit is set if the node is a host for any directive (including a component) */ isDirectiveHost = 0x1, /** - * This bit is set if the node is a host for a component. Setting this bit implies that the - * isDirectiveHost bit is set as well. */ + * Bit #2 - This bit is set if the node is a host for a component. + * + * Setting this bit implies that the `isDirectiveHost` bit is set as well. + * */ isComponentHost = 0x2, - /** This bit is set if the node has been projected */ + /** Bit #3 - This bit is set if the node has been projected */ isProjected = 0x4, - /** This bit is set if any directive on this node has content queries */ + /** Bit #4 - This bit is set if any directive on this node has content queries */ hasContentQuery = 0x8, - /** This bit is set if the node has any "class" inputs */ + /** Bit #5 - This bit is set if the node has any "class" inputs */ hasClassInput = 0x10, - /** This bit is set if the node has any "style" inputs */ + /** Bit #6 - This bit is set if the node has any "style" inputs */ hasStyleInput = 0x20, - /** This bit is set if the node has initial styling */ + /** Bit #7 - This bit is set if the node has initial styling */ hasInitialStyling = 0x40, - /** This bit is set if the node has been detached by i18n */ + /** Bit #8 - This bit is set if the node has been detached by i18n */ isDetached = 0x80, /** - * This bit is set if the node has directives with host bindings. This flags allows us to guard - * host-binding logic and invoke it only on nodes that actually have directives with host - * bindings. + * Bit #9 - This bit is set if the node has directives with host bindings. + * + * This flags allows us to guard host-binding logic and invoke it only on nodes + * that actually have directives with host bindings. */ hasHostBindings = 0x100, }