perf(ivy): remove global state access in createEmbeddedViewAndNode (#31959)
PR Close #31959
This commit is contained in:
parent
a8e2ee1343
commit
6f98107d5e
@ -11,7 +11,7 @@ import {assertLContainerOrUndefined} from '../assert';
|
|||||||
import {ACTIVE_INDEX, CONTAINER_HEADER_OFFSET, LContainer} from '../interfaces/container';
|
import {ACTIVE_INDEX, CONTAINER_HEADER_OFFSET, LContainer} from '../interfaces/container';
|
||||||
import {RenderFlags} from '../interfaces/definition';
|
import {RenderFlags} from '../interfaces/definition';
|
||||||
import {TContainerNode, TNodeType} from '../interfaces/node';
|
import {TContainerNode, TNodeType} from '../interfaces/node';
|
||||||
import {FLAGS, LView, LViewFlags, PARENT, QUERIES, TVIEW, TView, T_HOST} from '../interfaces/view';
|
import {FLAGS, LView, LViewFlags, PARENT, TVIEW, TView, T_HOST} from '../interfaces/view';
|
||||||
import {assertNodeType} from '../node_assert';
|
import {assertNodeType} from '../node_assert';
|
||||||
import {insertView, removeView} from '../node_manipulation';
|
import {insertView, removeView} from '../node_manipulation';
|
||||||
import {enterView, getIsParent, getLView, getPreviousOrParentTNode, isCreationMode, leaveView, setIsParent, setPreviousOrParentTNode} from '../state';
|
import {enterView, getIsParent, getLView, getPreviousOrParentTNode, isCreationMode, leaveView, setIsParent, setPreviousOrParentTNode} from '../state';
|
||||||
|
@ -369,16 +369,11 @@ export function allocExpando(view: LView, numSlotsToAlloc: number) {
|
|||||||
//////////////////////////
|
//////////////////////////
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used for creating the LViewNode of a dynamic embedded view,
|
* Used for creating the LView of a dynamic embedded view, either through
|
||||||
* either through ViewContainerRef.createEmbeddedView() or TemplateRef.createEmbeddedView().
|
* ViewContainerRef.createEmbeddedView() or TemplateRef.createEmbeddedView().
|
||||||
* Such lViewNode will then be renderer with renderEmbeddedTemplate() (see below).
|
|
||||||
*/
|
*/
|
||||||
export function createEmbeddedViewAndNode<T>(
|
export function createEmbeddedViewAndNode<T>(
|
||||||
tView: TView, context: T, declarationView: LView, injectorIndex: number): LView {
|
tView: TView, context: T, declarationView: LView, injectorIndex: number): LView {
|
||||||
const _isParent = getIsParent();
|
|
||||||
const _previousOrParentTNode = getPreviousOrParentTNode();
|
|
||||||
setPreviousOrParentTNode(null !, true);
|
|
||||||
|
|
||||||
const lView = createLView(declarationView, tView, context, LViewFlags.CheckAlways, null, null);
|
const lView = createLView(declarationView, tView, context, LViewFlags.CheckAlways, null, null);
|
||||||
lView[DECLARATION_VIEW] = declarationView;
|
lView[DECLARATION_VIEW] = declarationView;
|
||||||
|
|
||||||
@ -388,7 +383,6 @@ export function createEmbeddedViewAndNode<T>(
|
|||||||
tView.node !.injectorIndex = injectorIndex;
|
tView.node !.injectorIndex = injectorIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
setPreviousOrParentTNode(_previousOrParentTNode, _isParent);
|
|
||||||
return lView;
|
return lView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user