fix(ivy): Implement remaining methods for DebugNode (#27387)
PR Close #27387
This commit is contained in:
@ -14,7 +14,7 @@ import {LView, TData} from './view';
|
||||
|
||||
export const TNODE = 8;
|
||||
export const PARENT_INJECTOR = 8;
|
||||
export const INJECTOR_SIZE = 9;
|
||||
export const INJECTOR_BLOOM_PARENT_SIZE = 9;
|
||||
|
||||
/**
|
||||
* Represents a relative location of parent injector.
|
||||
|
@ -28,23 +28,17 @@ export const enum TNodeType {
|
||||
* Corresponds to the TNode.flags property.
|
||||
*/
|
||||
export const enum TNodeFlags {
|
||||
/** The number of directives on this node is encoded on the least significant bits */
|
||||
DirectiveCountMask = 0b00000000000000000000111111111111,
|
||||
|
||||
/** This bit is set if the node is a component */
|
||||
isComponent = 0b00000000000000000001000000000000,
|
||||
isComponent = 0b0001,
|
||||
|
||||
/** This bit is set if the node has been projected */
|
||||
isProjected = 0b00000000000000000010000000000000,
|
||||
isProjected = 0b0010,
|
||||
|
||||
/** This bit is set if the node has any content queries */
|
||||
hasContentQuery = 0b00000000000000000100000000000000,
|
||||
hasContentQuery = 0b0100,
|
||||
|
||||
/** This bit is set if the node has any directives that contain [class properties */
|
||||
hasClassInput = 0b00000000000000001000000000000000,
|
||||
|
||||
/** The index of the first directive on this node is encoded on the most significant bits */
|
||||
DirectiveStartingIndexShift = 16,
|
||||
hasClassInput = 0b1000,
|
||||
}
|
||||
|
||||
/**
|
||||
@ -128,13 +122,17 @@ export interface TNode {
|
||||
injectorIndex: number;
|
||||
|
||||
/**
|
||||
* This number stores two values using its bits:
|
||||
*
|
||||
* - the number of directives on that node (first 12 bits)
|
||||
* - the starting index of the node's directives in the directives array (last 20 bits).
|
||||
*
|
||||
* These two values are necessary so DI can effectively search the directives associated
|
||||
* with a node without searching the whole directives array.
|
||||
* Stores starting index of the directives.
|
||||
*/
|
||||
directiveStart: number;
|
||||
|
||||
/**
|
||||
* Stores final exclusive index of the directives.
|
||||
*/
|
||||
directiveEnd: number;
|
||||
|
||||
/**
|
||||
* Stores if Node isComponent, isProjected, hasContentQuery and hasClassInput
|
||||
*/
|
||||
flags: TNodeFlags;
|
||||
|
||||
@ -144,6 +142,7 @@ export interface TNode {
|
||||
* - the index of the first provider on that node (first 16 bits)
|
||||
* - the count of view providers from the component on this node (last 16 bits)
|
||||
*/
|
||||
// TODO(misko): break this into actual vars.
|
||||
providerIndexes: TNodeProviderIndexes;
|
||||
|
||||
/** The tag name associated with this node. */
|
||||
|
@ -446,19 +446,25 @@ export interface TView {
|
||||
* saves on memory (70 bytes per array) and on a few bytes of code size (for two
|
||||
* separate for loops).
|
||||
*
|
||||
* If it's a native DOM listener being stored:
|
||||
* 1st index is: event name to remove
|
||||
* 2nd index is: index of native element in LView.data[]
|
||||
* 3rd index is: index of wrapped listener function in LView.cleanupInstances[]
|
||||
* 4th index is: useCapture boolean
|
||||
* If it's a native DOM listener or output subscription being stored:
|
||||
* 1st index is: event name `name = tView.cleanup[i+0]`
|
||||
* 2nd index is: index of native element `element = lView[tView.cleanup[i+1]]`
|
||||
* 3rd index is: index of listener function `listener = lView[CLEANUP][tView.cleanup[i+2]]`
|
||||
* 4th index is: `useCaptureOrIndx = tView.cleanup[i+3]`
|
||||
* `typeof useCaptureOrIndx == 'boolean' : useCapture boolean
|
||||
* `typeof useCaptureOrIndx == 'number':
|
||||
* `useCaptureOrIndx >= 0` `removeListener = LView[CLEANUP][useCaptureOrIndx]`
|
||||
* `useCaptureOrIndx < 0` `subscription = LView[CLEANUP][-useCaptureOrIndx]`
|
||||
*
|
||||
* If it's a renderer2 style listener or ViewRef destroy hook being stored:
|
||||
* 1st index is: index of the cleanup function in LView.cleanupInstances[]
|
||||
* 2nd index is: null
|
||||
* 2nd index is: `null`
|
||||
* `lView[CLEANUP][tView.cleanup[i+0]]()`
|
||||
*
|
||||
* If it's an output subscription or query list destroy hook:
|
||||
* 1st index is: output unsubscribe function / query list destroy function
|
||||
* 2nd index is: index of function context in LView.cleanupInstances[]
|
||||
* `tView.cleanup[i+0].call(lView[CLEANUP][tView.cleanup[i+1]])`
|
||||
*/
|
||||
cleanup: any[]|null;
|
||||
|
||||
|
Reference in New Issue
Block a user