Skip to content

Commit

Permalink
Fix for Polymer#27
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed May 7, 2014
1 parent 437dfd1 commit 98e9c9b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
6 changes: 2 additions & 4 deletions src/instance/properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,8 @@
},
closeNamedObservers: function() {
if (this._namedObservers) {
var keys=Object.keys(this._namedObservers);
for (var i=0, l=keys.length, k, o; (i < l) && (k=keys[i]); i++) {
o = this._namedObservers[k];
o.close();
for (var i in this._namedObservers) {
this.closeNamedObserver(i);
}
this._namedObservers = {};
}
Expand Down
15 changes: 12 additions & 3 deletions test/html/property-array-changes.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@
test5: function() {
chai.assert.equal(this.a.length, 1, 'noticed array removal');
a.push(55);
setTimeout(function() {
this.nextTest();
}.bind(this), 50);
setTimeout(this.nextTest.bind(this), 0);
},
test6: function() {
chai.assert.equal(this.a.length, 1, 'old array properly unobserved');
Expand All @@ -78,6 +76,17 @@
},
test7: function() {
chai.assert.equal(this.b.length, 1, 'noticed array addition');
this.async(this.nextTest);
},
test8: function() {
this.a = '';
},
test9: function() {
this.parentNode.removeChild(this);
setTimeout(this.nextTest.bind(this), 50);
},
test10: function() {
chai.assert.isTrue(this._unbound, 'element unbound without error');
}
});
})();
Expand Down

0 comments on commit 98e9c9b

Please sign in to comment.