Include wildcard character in identifier. Fixes #3084.

This commit is contained in:
Kevin Schaaf 2015-11-24 14:16:13 -05:00
parent e5fb166c50
commit c36d6c1750
3 changed files with 11 additions and 1 deletions

View File

@ -90,7 +90,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
},
_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 = '(?:' + '"(?:[^"\\\\]|\\\\.)*"' + ')';

View File

@ -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}}"
@ -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>

View File

@ -269,6 +269,12 @@ suite('single-element binding effects', function() {
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>