Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Fix path retrieval failure within named scope expression
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelw committed Jun 6, 2014
1 parent a701b15 commit 436c365
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/polymer-expressions.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@
(object instanceof MemberExpression || object instanceof IdentPath);

this.object = this.simplePath ? object : getFn(object);
this.property = !this.computed ? property : getFn(property);
this.property = !this.computed || this.simplePath ?
property : getFn(property);
}

MemberExpression.prototype = {
Expand Down
18 changes: 18 additions & 0 deletions tests/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2004,4 +2004,22 @@ suite('PolymerExpressions', function() {
});
});

test('issue-35', function(done) {
var div = createTestHtml(
'<template bind="{{ data[0] as foo }}">' +
'{{ foo.value }}' +
'</template>');

var model = {
data: [{ value: 'bar' }]
};

recursivelySetTemplateModel(div, model);

then(function() {
assert.strictEqual(div.childNodes[1].textContent, 'bar');
done();
});
});

});

0 comments on commit 436c365

Please sign in to comment.