Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(ivy): use hex flags instead of binary for TNodeFlags #33605

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
45 changes: 24 additions & 21 deletions packages/core/src/render3/interfaces/node.ts
Expand Up @@ -45,38 +45,41 @@ 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) */
isDirectiveHost = 0b000000001,
/** 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. */
isComponentHost = 0b000000010,
* 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 */
isProjected = 0b000000100,
/** 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 */
hasContentQuery = 0b000001000,
/** 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 */
hasClassInput = 0b000010000,
/** 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 */
hasStyleInput = 0b000100000,
/** 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 */
hasInitialStyling = 0b001000000,
/** 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 */
isDetached = 0b010000000,
/** 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 = 0b100000000,
hasHostBindings = 0x100,
}

/**
Expand Down