From e8df000e97245d2a9c3b00b8b5e5e25dbf4bc42a Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Fri, 15 Mar 2019 13:24:52 -0700 Subject: [PATCH] refactor(ivy): update TNodeType (#29343) - Remove an extra type `ViewOrElement`, which even had the same numeric value as `View`. - Updates comment to remove part about alleged bit-masking that we could be doing here. We aren't using this with bitmasks, and if we were, everything would be a `NodeType.Container`, because it's value was `0`. - Updates the number values to be simple, human-readable integers, since we're not using these with any kind of bit-manipulation. - Add comments about each type. PR Close #29343 --- packages/core/src/render3/interfaces/node.ts | 34 ++++++++++++++------ 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/packages/core/src/render3/interfaces/node.ts b/packages/core/src/render3/interfaces/node.ts index 7eadf2c58c..0874abd259 100644 --- a/packages/core/src/render3/interfaces/node.ts +++ b/packages/core/src/render3/interfaces/node.ts @@ -12,17 +12,33 @@ import {LView, TView} from './view'; /** - * TNodeType corresponds to the TNode.type property. It contains information - * on how to map a particular set of bits in TNode.flags to the node type. + * TNodeType corresponds to the {@link TNode} `type` property. */ export const enum TNodeType { - Container = 0b000, - Projection = 0b001, - View = 0b010, - Element = 0b011, - ViewOrElement = 0b010, - ElementContainer = 0b100, - IcuContainer = 0b101, + /** + * The TNode contains information about an {@link LContainer} for embedded views. + */ + Container = 0, + /** + * The TNode contains information about an `` projection + */ + Projection = 1, + /** + * The TNode contains information about an {@link LView} + */ + View = 2, + /** + * The TNode contains information about a DOM element aka {@link RNode}. + */ + Element = 3, + /** + * The TNode contains information about an `` element {@link RNode}. + */ + ElementContainer = 4, + /** + * The TNode contains information about an ICU comment used in `i18n`. + */ + IcuContainer = 5, } /**