From 309f77ba2989388d69fe1ee6e8912b6337c4c2f2 Mon Sep 17 00:00:00 2001 From: Kevin Schaaf Date: Tue, 16 Jul 2019 15:56:09 -0700 Subject: [PATCH] Remove use of Object.create on template info (significant perf impact). --- lib/mixins/property-effects.js | 2 +- lib/mixins/template-stamp.js | 4 ++-- test/unit/dom-if.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/mixins/property-effects.js b/lib/mixins/property-effects.js index 5988b2df8c..0f231335d5 100644 --- a/lib/mixins/property-effects.js +++ b/lib/mixins/property-effects.js @@ -2721,7 +2721,7 @@ export const PropertyEffects = dedupingMixin(superClass => { // stamped, and may be stamped more than once (in which case instances // of the template info will be in the tree under its parent more than // once). - const parent = templateInfo.parent || this.__templateInfo; + const parent = template._parentTemplateInfo || this.__templateInfo; const previous = parent.lastChild; parent.lastChild = templateInfo; templateInfo.previousSibling = previous; diff --git a/lib/mixins/template-stamp.js b/lib/mixins/template-stamp.js index 924b8fa8ea..e7cf425a90 100644 --- a/lib/mixins/template-stamp.js +++ b/lib/mixins/template-stamp.js @@ -75,8 +75,8 @@ function applyEventListener(inst, node, nodeInfo) { function applyTemplateContent(inst, node, nodeInfo, parentTemplateInfo) { if (nodeInfo.templateInfo) { // Give the node an instance of this templateInfo and set its parent - node._templateInfo = Object.create(nodeInfo.templateInfo); - node._templateInfo.parent = parentTemplateInfo; + node._templateInfo = nodeInfo.templateInfo; + node._parentTemplateInfo = parentTemplateInfo; } } diff --git a/test/unit/dom-if.html b/test/unit/dom-if.html index aa115da199..d32c08933c 100644 --- a/test/unit/dom-if.html +++ b/test/unit/dom-if.html @@ -895,7 +895,7 @@ document.body.removeChild(el); }); - test.only('host properties in sync toggling true-false-true synchronously', function() { + test('host properties in sync toggling true-false-true synchronously', function() { let el = document.createElement('x-guard-separate-props'); el.restamp = restamp; document.body.appendChild(el);