diff --git a/src/polymer-expressions.js b/src/polymer-expressions.js index 3f68492..1a28212 100644 --- a/src/polymer-expressions.js +++ b/src/polymer-expressions.js @@ -389,13 +389,16 @@ var self = this; function valueFn() { - if (self.dynamicDeps) + // TODO(rafaelw): + // https://github.com/Polymer/polymer-expressions/issues/21 + var updateObserver = true; //self.dynamicDeps; + if (updateObserver) observer.startReset(); var value = self.getValue(model, - self.dynamicDeps ? observer : undefined, + updateObserver ? observer : undefined, filterRegistry); - if (self.dynamicDeps) + if (updateObserver) observer.finishReset(); return value; diff --git a/tests/tests.js b/tests/tests.js index e40df6a..adae2bf 100644 --- a/tests/tests.js +++ b/tests/tests.js @@ -969,6 +969,35 @@ suite('PolymerExpressions', function() { }); }); + test('computed - newly reachable objects', function(done) { + var div = createTestHtml( + ''); + + var model = {}; + + recursivelySetTemplateModel(div, model); + + then(function() { + assert.equal('false', div.childNodes[1].getAttribute('foo')); + model.foo = {}; + + }).then(function() { + assert.equal('false', div.childNodes[1].getAttribute('foo')); + model.foo.bar = {}; + + }).then(function() { + assert.equal('false', div.childNodes[1].getAttribute('foo')); + model.foo.bar.bat = 1; + + }).then(function() { + assert.equal('true', div.childNodes[1].getAttribute('foo')); + + done(); + }); + }); + test('computed property with ident index', function(done) { var div = createTestHtml(