From d6f3a9ffbb970c498726650431027cd062fb4b40 Mon Sep 17 00:00:00 2001 From: Kevin Schaaf Date: Tue, 16 Jul 2019 18:14:22 -0700 Subject: [PATCH] Added comments. --- lib/mixins/property-effects.js | 55 +++++++++++++++++++++++++++------- 1 file changed, 44 insertions(+), 11 deletions(-) diff --git a/lib/mixins/property-effects.js b/lib/mixins/property-effects.js index 0f231335d5..44bd526dd0 100644 --- a/lib/mixins/property-effects.js +++ b/lib/mixins/property-effects.js @@ -2666,10 +2666,43 @@ export const PropertyEffects = dedupingMixin(superClass => { // -- binding ---------------------------------------------- + /* + * Overview of binding flow: + * + * During finalization (`instanceBinding==false`, `wasPreBound==false`): + * `_bindTemplate(false)` called directly during finalization - parses the + * template (for the first time), and then assigns that _prototypical_ + * template info to `__preboundTemplateInfo` _on the prototype_; note in + * this case `wasPreBound` is false; this is the first time we're binding + * it, thus we create accessors. + * + * During first stamping (`instanceBinding==true`, `wasPreBound==true`): + * `_stampTemplate` calls `_bindTemplate(true)`: the `templateInfo` + * returned matches the prebound one, and so this is `wasPreBound == true` + * state; thus we _skip_ creating accessors, but _do_ create a + * sub-instance of the template info to serve as the start of our linked + * list (needs to be an instance, not the prototypical one, so that we can + * add `nodeList` to it to contain the `nodeInfo`-ordered list of instance + * nodes for bindings, and so we can chain runtime-stamped template infos + * off of it). At this point, the call to `_stampTemplate` calls + * `applyTemplateInfo` for each nested `