mirror of
https://github.com/Polymer/polymer.git
synced 2025-02-25 18:55:30 -06:00
Include wildcard character in identifier. Fixes #3084.
This commit is contained in:
parent
e5fb166c50
commit
c36d6c1750
@ -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 = '(?:' + '"(?:[^"\\\\]|\\\\.)*"' + ')';
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user