Skip to content

Commit

Permalink
Fix bindings with special characters
Browse files Browse the repository at this point in the history
  • Loading branch information
TimvdLippe committed Feb 12, 2016
1 parent a4cc272 commit d385873
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/annotations/annotations.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
},

_bindingRegex: (function() {
var IDENT = '(?:' + '[a-zA-Z_$][\\w.:$-*]*' + ')';
var IDENT = '(?:' + '[a-zA-Z_$][\\w.:$\\-*]*' + ')';
var NUMBER = '(?:' + '[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?' + ')';
var SQUOTE_STRING = '(?:' + '\'(?:[^\'\\\\]|\\\\.)*\'' + ')';
var DQUOTE_STRING = '(?:' + '"(?:[^"\\\\]|\\\\.)*"' + ')';
Expand Down
4 changes: 4 additions & 0 deletions test/unit/bind-elements.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
<div id="compound2">
literal1 {{cpnd1}} literal2 {{cpnd2}}{{cpnd3.prop}} literal3 {{computeCompound(cpnd4, cpnd5, 'literal')}} literal4
</div>
<span id="boundWithDash">{{objectWithDash.binding-with-dash}}</span>
</template>
<script>
Polymer({
Expand Down Expand Up @@ -134,6 +135,9 @@
},
noComputedProp: {
computed: 'foobared(noComputed)'
},
objectWithDash: {
type: Object
}
},
observers: [
Expand Down
7 changes: 7 additions & 0 deletions test/unit/bind.html
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,13 @@
assert.equal(el.$.boundChild.computedWildcard, 15);
});

test('binding with dash', function() {
el.objectWithDash = {
'binding-with-dash': 'yes'
};
assert.equal(el.$.boundWithDash.textContent, 'yes');
})

});

</script>
Expand Down

0 comments on commit d385873

Please sign in to comment.