Skip to content

Commit 4f9fda0

Browse files
committed
Minor simplifications/comments.
1 parent f0cbc83 commit 4f9fda0

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

lib/mixins/property-effects.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2703,12 +2703,12 @@ export const PropertyEffects = dedupingMixin(superClass => {
27032703
// effects are run; if this template was not nested in another
27042704
// template, use the root template (the first stamped one) as the
27052705
// parent. Note, `parent` is the `templateInfo` instance for this
2706-
// template's containing template, which was set up in
2707-
// `applyTemplateContent`. While a given template's `parent` is
2708-
// given, it is only added to the parent list at the point that it is
2709-
// being bound, since a template may or may not ever be stamped, and
2710-
// may be stamped more than once (in which case it will be in the
2711-
// tree more than once).
2706+
// template's parent (containing) template, which was set up in
2707+
// `applyTemplateContent`. While a given template's `parent` is set
2708+
// apriori, it is only added to the parent list at the point that it
2709+
// is being bound, since a template may or may not ever be stamped,
2710+
// and may be stamped more than once (in which case instances of the
2711+
// template info will be in the tree under its parent more than once).
27122712
const parent = templateInfo.parent || this.__templateInfo;
27132713
const previous = parent.lastChild;
27142714
parent.lastChild = templateInfo;
@@ -2807,7 +2807,7 @@ export const PropertyEffects = dedupingMixin(superClass => {
28072807
* @protected
28082808
*/
28092809
_removeBoundDom(dom) {
2810-
// Unlink template info; Note that while the child is unlinked from its
2810+
// Unlink template info; Note that while the child is unlinked from its
28112811
// parent list, a template's `parent` reference is never removed, since
28122812
// this is is determined by the tree structure and applied at
28132813
// `applyTemplateContent` time.
@@ -2964,10 +2964,12 @@ export const PropertyEffects = dedupingMixin(superClass => {
29642964
// onto the parent (dom-if/repeat element)'s nodeInfo
29652965
if (removeNestedTemplates && (isDomIf || isDomRepeat)) {
29662966
parent.removeChild(node);
2967-
nodeInfo.parentInfo.templateInfo = nestedTemplateInfo;
2968-
// Ensure the parent dom-if/repeat is noted since it now has bindings;
2969-
// it may not have been if it did not have its own bindings
2967+
// Use the parent's nodeInfo (for the dom-if/repeat) to record the
2968+
// templateInfo, and use that for any host property bindings below
29702969
nodeInfo = nodeInfo.parentInfo;
2970+
nodeInfo.templateInfo = nestedTemplateInfo;
2971+
// Ensure the parent dom-if/repeat is noted since it now may have host
2972+
// bindings; it may not have been if it did not have its own bindings
29712973
nodeInfo.noted = true;
29722974
noted = false;
29732975
}

0 commit comments

Comments
 (0)