Skip to content

Commit 1e8b656

Browse files
committed
Improve comments.
1 parent d6f3a9f commit 1e8b656

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

lib/mixins/property-effects.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2670,34 +2670,34 @@ export const PropertyEffects = dedupingMixin(superClass => {
26702670
* Overview of binding flow:
26712671
*
26722672
* During finalization (`instanceBinding==false`, `wasPreBound==false`):
2673-
* `_bindTemplate(false)` called directly during finalization - parses the
2674-
* template (for the first time), and then assigns that _prototypical_
2673+
* `_bindTemplate(t, false)` called directly during finalization - parses
2674+
* the template (for the first time), and then assigns that _prototypical_
26752675
* template info to `__preboundTemplateInfo` _on the prototype_; note in
26762676
* this case `wasPreBound` is false; this is the first time we're binding
26772677
* it, thus we create accessors.
26782678
*
26792679
* During first stamping (`instanceBinding==true`, `wasPreBound==true`):
2680-
* `_stampTemplate` calls `_bindTemplate(true)`: the `templateInfo`
2680+
* `_stampTemplate` calls `_bindTemplate(t, true)`: the `templateInfo`
26812681
* returned matches the prebound one, and so this is `wasPreBound == true`
2682-
* state; thus we _skip_ creating accessors, but _do_ create a
2683-
* sub-instance of the template info to serve as the start of our linked
2684-
* list (needs to be an instance, not the prototypical one, so that we can
2685-
* add `nodeList` to it to contain the `nodeInfo`-ordered list of instance
2686-
* nodes for bindings, and so we can chain runtime-stamped template infos
2687-
* off of it). At this point, the call to `_stampTemplate` calls
2682+
* state; thus we _skip_ creating accessors, but _do_ create an instance
2683+
* of the template info to serve as the start of our linked list (needs to
2684+
* be an instance, not the prototypical one, so that we can add `nodeList`
2685+
* to it to contain the `nodeInfo`-ordered list of instance nodes for
2686+
* bindings, and so we can chain runtime-stamped template infos off of
2687+
* it). At this point, the call to `_stampTemplate` calls
26882688
* `applyTemplateInfo` for each nested `<template>` found during parsing
26892689
* to hand prototypical `_templateInfo` to them; we also pass the _parent_
26902690
* `templateInfo` to the `<template>` so that we have the instance-time
26912691
* parent to link the `templateInfo` under in the case it was
26922692
* runtime-stamped.
26932693
*
26942694
* During subsequent runtime stamping (`instanceBinding==true`,
2695-
* `wasPreBound==false`): `_stampTemplate` calls `_bindTemplate(true)` -
2696-
* here `templateInfo` is guaranteed to _not_ match the prebound one,
2695+
* `wasPreBound==false`): `_stampTemplate` calls `_bindTemplate(t, true)`
2696+
* - here `templateInfo` is guaranteed to _not_ match the prebound one,
26972697
* because it was either a different template altogether, or even if it
2698-
* was the same template, the step above created a sub-instance of the
2699-
* info; in this case `wasPreBound == false`, so we _do_ create accessors,
2700-
* _and_ link a sub-instance into the linked list.
2698+
* was the same template, the step above created a instance of the info;
2699+
* in this case `wasPreBound == false`, so we _do_ create accessors, _and_
2700+
* link a instance into the linked list.
27012701
*/
27022702

27032703
/**
@@ -2748,7 +2748,7 @@ export const PropertyEffects = dedupingMixin(superClass => {
27482748
// template, use the root template (the first stamped one) as the
27492749
// parent. Note, `parent` is the `templateInfo` instance for this
27502750
// template's parent (containing) template, which was set up in
2751-
// `applyTemplateContent`. While a given template's `parent` is set
2751+
// `applyTemplateInfo`. While a given template's `parent` is set
27522752
// apriori, it is only added to the parent's child list at the point
27532753
// that it is being bound, since a template may or may not ever be
27542754
// stamped, and may be stamped more than once (in which case instances
@@ -2863,7 +2863,7 @@ export const PropertyEffects = dedupingMixin(superClass => {
28632863
// Unlink template info; Note that while the child is unlinked from its
28642864
// parent list, a template's `parent` reference is never removed, since
28652865
// this is is determined by the tree structure and applied at
2866-
// `applyTemplateContent` time.
2866+
// `applyTemplateInfo` time.
28672867
let templateInfo = dom.templateInfo;
28682868
const {previousSibling, nextSibling, parent} = templateInfo;
28692869
if (previousSibling) {

lib/mixins/template-stamp.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function applyEventListener(inst, node, nodeInfo) {
7272
}
7373

7474
// push configuration references at configure time
75-
function applyTemplateContent(inst, node, nodeInfo, parentTemplateInfo) {
75+
function applyTemplateInfo(inst, node, nodeInfo, parentTemplateInfo) {
7676
if (nodeInfo.templateInfo) {
7777
// Give the node an instance of this templateInfo and set its parent
7878
node._templateInfo = nodeInfo.templateInfo;
@@ -466,7 +466,7 @@ export const TemplateStamp = dedupingMixin(
466466
for (let i=0, l=nodeInfo.length, info; (i<l) && (info=nodeInfo[i]); i++) {
467467
let node = nodes[i] = findTemplateNode(dom, info);
468468
applyIdToMap(this, dom.$, node, info);
469-
applyTemplateContent(this, node, info, templateInfo);
469+
applyTemplateInfo(this, node, info, templateInfo);
470470
applyEventListener(this, node, info);
471471
}
472472
dom = /** @type {!StampedTemplate} */(dom); // eslint-disable-line no-self-assign

0 commit comments

Comments
 (0)