Skip to content

Commit

Permalink
Include wildcard character in identifier. Fixes #3084.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Nov 24, 2015
1 parent e5fb166 commit c36d6c1
Show file tree
Hide file tree
Showing 3 changed files with 11 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 @@ -13,6 +13,7 @@
neg-computed-inline="{{!computeInline(value,add,divide)}}"
computed-negative-number="{{computeNegativeNumber(-1)}}"
computed-negative-literal="{{computeNegativeNumber(-A)}}"
computed-wildcard="{{computeWildcard(a, b.*)}}"
style$="{{boundStyle}}"
data-id$="{{dataSetId}}"
custom-event-value="{{customEventValue::custom}}"
Expand Down Expand Up @@ -256,6 +257,9 @@
},
computeCompound: function(a, b, c) {
return '' + c + b + a;
},
computeWildcard: function(a, bInfo) {
return a + (bInfo && bInfo.base ? bInfo.base.value : 0);
}
});
</script>
Expand Down
6 changes: 6 additions & 0 deletions test/unit/bind.html
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,12 @@
assert.equal(el.$.boundChild.computedNegativeLiteral, undefined);
});

test('computed binding with wildcard', function() {
el.a = 5;
el.b = {value: 10};
assert.equal(el.$.boundChild.computedWildcard, 15);
});

});

</script>
Expand Down

0 comments on commit c36d6c1

Please sign in to comment.