From ad64879e532c2509ee1018725f6aa6545689cc91 Mon Sep 17 00:00:00 2001 From: Rafael Weinstein Date: Wed, 4 Sep 2013 18:45:20 -0700 Subject: [PATCH] avoid calling isTemplate for every instance created R=arv BUG= Review URL: https://codereview.appspot.com/13235049 --- src/TemplateBinding.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/TemplateBinding.js b/src/TemplateBinding.js index da4e453..62b66f2 100644 --- a/src/TemplateBinding.js +++ b/src/TemplateBinding.js @@ -785,7 +785,7 @@ function deepCloneIgnoreTemplateContent(node, delegate) { var clone = node.cloneNode(false); - if (isTemplate(clone)) { + if (node.isTemplate_) { return clone; } @@ -799,6 +799,7 @@ function createInstanceBindingMap(node, delegatePrepareBindingFn) { var map = getBindings(node, delegatePrepareBindingFn); if (isTemplate(node)) { + node.isTemplate_ = true; map = map || []; map.templateRef = node; map.hasSubTemplate = true;