Skip to content

Commit

Permalink
Fix undefined class attribute in undefined template scope
Browse files Browse the repository at this point in the history
  • Loading branch information
TimvdLippe committed Mar 15, 2016
1 parent edb59eb commit e21c59e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/template/templatizer.html
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@
if (host) {
return host._scopeElementClass(node, value);
}
return value;
},

/**
Expand Down
10 changes: 10 additions & 0 deletions test/unit/bind.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
<link rel="import" href="../../polymer.html">
<link rel="import" href="bind-elements.html">
<body>
<template id="class-repeat" is="dom-repeat" items='["class1", "class2"]'>
<div class$=[[item]] clazz$="[[item]]">[[item]]</div>
</template>
<script>

suite('single-element binding effects', function() {
Expand Down Expand Up @@ -286,6 +289,13 @@
assert.equal(el.$.boundWithDash.textContent, 'yes');
});

test('class attribute without template scope not erased', function() {
var el = document.querySelector('.class1');
assert.notEqual(el, null, 'class without template scope is undefined');
var el2 = document.querySelector('.class2');
assert.notEqual(el2, null, 'class without template scope is undefined');
});

});

</script>
Expand Down

0 comments on commit e21c59e

Please sign in to comment.