refactor(core): Ensure that previousOrParentTNode always belongs to current TView. (#38707)

`previousOrParentTNode` stores current `TNode`. Due to inconsistent
implementation the value stored would sometimes belong to the current
`TView` and sometimes to the parent. We have extra logic which accounts
for it. A better solution is to just ensure that `previousOrParentTNode`
always belongs to current `TNode`. This simplifies the mental model
and cleans up some code.

PR Close #38707
This commit is contained in:
Misko Hevery
2020-09-03 22:46:11 -07:00
parent 689651b52f
commit 33aaa9e7d0
21 changed files with 63 additions and 29 deletions

View File

@ -20,7 +20,7 @@ function fakeLView(): LView {
}
describe('sanitization', () => {
beforeEach(() => enterView(fakeLView(), null));
beforeEach(() => enterView(fakeLView()));
afterEach(() => leaveView());
class Wrap {
constructor(private value: string) {}