Skip to content

Commit

Permalink
Remove use of Object.create on template info (significant perf impact).
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Jul 16, 2019
1 parent b046a59 commit 309f77b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/mixins/property-effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions lib/mixins/template-stamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/unit/dom-if.html
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 309f77b

Please sign in to comment.