refactor(ivy): correct circular dependency which causes g3 failures (#31665)
PR Close #31665
This commit is contained in:

committed by
Kara Erickson

parent
f10d6c66c9
commit
f14693b9a4
@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
import {Injector} from '../../di/injector';
|
||||
|
||||
import {assertLView} from '../assert';
|
||||
import {discoverLocalRefs, getComponentAtNodeIndex, getDirectivesAtNodeIndex, getLContext} from '../context_discovery';
|
||||
import {NodeInjector} from '../di';
|
||||
@ -15,6 +14,7 @@ import {LContext} from '../interfaces/context';
|
||||
import {DirectiveDef} from '../interfaces/definition';
|
||||
import {TElementNode, TNode, TNodeProviderIndexes} from '../interfaces/node';
|
||||
import {CLEANUP, CONTEXT, FLAGS, HOST, LView, LViewFlags, TVIEW} from '../interfaces/view';
|
||||
|
||||
import {stringifyForError} from './misc_utils';
|
||||
import {getLViewParent, getRootContext} from './view_traversal_utils';
|
||||
import {unwrapRNode} from './view_utils';
|
||||
|
@ -9,9 +9,11 @@
|
||||
import {assertDefined} from '../../util/assert';
|
||||
import {assertLView} from '../assert';
|
||||
import {TNodeType} from '../interfaces/node';
|
||||
import {isLContainer, isLView} from '../interfaces/type_checks';
|
||||
import {CONTEXT, DECLARATION_VIEW, FLAGS, LView, LViewFlags, PARENT, RootContext, T_HOST} from '../interfaces/view';
|
||||
|
||||
import {isLContainer, isLView, readPatchedLView} from './view_utils';
|
||||
import {readPatchedLView} from './view_utils';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -6,15 +6,15 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {assertDataInRange, assertDefined, assertDomNode, assertEqual, assertGreaterThan, assertLessThan} from '../../util/assert';
|
||||
import {assertDataInRange, assertDefined, assertDomNode, assertGreaterThan, assertLessThan} from '../../util/assert';
|
||||
import {assertTNodeForLView} from '../assert';
|
||||
import {LContainer, TYPE} from '../interfaces/container';
|
||||
import {LContext, MONKEY_PATCH_KEY_NAME} from '../interfaces/context';
|
||||
import {ComponentDef, DirectiveDef} from '../interfaces/definition';
|
||||
import {TNode, TNodeFlags} from '../interfaces/node';
|
||||
import {TNode} from '../interfaces/node';
|
||||
import {RNode} from '../interfaces/renderer';
|
||||
import {StylingContext} from '../interfaces/styling';
|
||||
import {FLAGS, HEADER_OFFSET, HOST, LView, LViewFlags, PARENT, PREORDER_HOOK_FLAGS, TData, TVIEW, TView} from '../interfaces/view';
|
||||
import {isLContainer, isLView} from '../interfaces/type_checks';
|
||||
import {FLAGS, HEADER_OFFSET, HOST, LView, LViewFlags, PARENT, PREORDER_HOOK_FLAGS, TData, TVIEW} from '../interfaces/view';
|
||||
|
||||
|
||||
|
||||
@ -93,32 +93,6 @@ export function unwrapStylingContext(value: RNode | LView | LContainer | Styling
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* True if `value` is `LView`.
|
||||
* @param value wrapped value of `RNode`, `LView`, `LContainer`, `StylingContext`
|
||||
*/
|
||||
export function isLView(value: RNode | LView | LContainer | StylingContext | {} | null):
|
||||
value is LView {
|
||||
return Array.isArray(value) && typeof value[TYPE] === 'object';
|
||||
}
|
||||
|
||||
/**
|
||||
* True if `value` is `LContainer`.
|
||||
* @param value wrapped value of `RNode`, `LView`, `LContainer`, `StylingContext`
|
||||
*/
|
||||
export function isLContainer(value: RNode | LView | LContainer | StylingContext | {} | null):
|
||||
value is LContainer {
|
||||
return Array.isArray(value) && value[TYPE] === true;
|
||||
}
|
||||
|
||||
/**
|
||||
* True if `value` is `StylingContext`.
|
||||
* @param value wrapped value of `RNode`, `LView`, `LContainer`, `StylingContext`
|
||||
*/
|
||||
export function isStylingContext(value: RNode | LView | LContainer | StylingContext | {} | null):
|
||||
value is StylingContext {
|
||||
return Array.isArray(value) && typeof value[TYPE] === 'number';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves an element value from the provided `viewData`, by unwrapping
|
||||
@ -187,21 +161,6 @@ export function getComponentViewByIndex(nodeIndex: number, hostView: LView): LVi
|
||||
return lView;
|
||||
}
|
||||
|
||||
export function isContentQueryHost(tNode: TNode): boolean {
|
||||
return (tNode.flags & TNodeFlags.hasContentQuery) !== 0;
|
||||
}
|
||||
|
||||
export function isComponent(tNode: TNode): boolean {
|
||||
return (tNode.flags & TNodeFlags.isComponent) === TNodeFlags.isComponent;
|
||||
}
|
||||
|
||||
export function isComponentDef<T>(def: DirectiveDef<T>): def is ComponentDef<T> {
|
||||
return (def as ComponentDef<T>).template !== null;
|
||||
}
|
||||
|
||||
export function isRootView(target: LView): boolean {
|
||||
return (target[FLAGS] & LViewFlags.IsRoot) !== 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the monkey-patch value data present on the target (which could be
|
||||
|
Reference in New Issue
Block a user