Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
cr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelw committed Apr 11, 2014
1 parent 180e4b5 commit 4c1e779
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/TemplateBinding.js
Original file line number Diff line number Diff line change
Expand Up @@ -903,26 +903,26 @@
return map;
}

var contentIdCounter = 1;
var contentUidCounter = 1;

// TODO(rafaelw): Setup a MutationObserver on content which clears the id
// so that bindingMaps regenerate when the template.content changes.
function getContentId(content) {
function getContentUid(content) {
var id = content.id_;
if (!id)
id = content.id_ = contentIdCounter++;
id = content.id_ = contentUidCounter++;
return id;
}

// Each delegate is associated with a set of bindingMaps, one for each
// content which may be used by a template. The intent is that each binding
// delegate gets the opportunity to prepare* the template content once
// across all uses.
// delegate gets the opportunity to prepare the instance (via the prepare*
// delegate calls) once across all uses.
// TODO(rafaelw): Separate out the parse map from the binding map. In the
// current implementation, if two delegates need a binding map for the same
// content, the second will have to reparse.
function getInstanceBindingMap(content, delegate_) {
var contentId = getContentId(content);
var contentId = getContentUid(content);
if (delegate_) {
var map = delegate_.bindingMaps[contentId];
if (!map) {
Expand Down

0 comments on commit 4c1e779

Please sign in to comment.