mirror of
https://github.com/Polymer/polymer.git
synced 2025-02-25 18:55:30 -06:00
Fix compound bindings with braces in literals
This commit is contained in:
parent
07d39a1be8
commit
561b28b8bc
@ -88,7 +88,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
this._parseElementAnnotations(node, list);
|
||||
},
|
||||
|
||||
_bindingRegex: /([^{[]*)({{|\[\[)([^}\]]*)(?:]]|}})/g,
|
||||
_bindingRegex: /([^{[]*)(\{\{|\[\[)(?!\}\}|\]\])(.+?)(?:\]\]|\}\})/g,
|
||||
|
||||
// TODO(kschaaf): We could modify this to allow an escape mechanism by
|
||||
// looking for the escape sequence in each of the matches and converting
|
||||
|
@ -26,6 +26,7 @@
|
||||
no-computed="{{foobared(noInlineComputed)}}"
|
||||
compoundAttr1$="{{cpnd1}}{{ cpnd2 }}{{cpnd3.prop}}{{ computeCompound(cpnd4, cpnd5, 'literal')}}"
|
||||
compoundAttr2$="literal1 {{cpnd1}} literal2 {{cpnd2}}{{cpnd3.prop}} literal3 {{computeCompound(cpnd4, cpnd5, 'literal')}} literal4"
|
||||
compoundAttr3$="{{computeCompound('world', 'username ', 'Hello {0} ')}}"
|
||||
>
|
||||
Test
|
||||
</div>
|
||||
|
@ -767,6 +767,12 @@ suite('compound binding / string interpolation', function() {
|
||||
assert.equal(el.$.boundChild.getAttribute('compoundAttr2'), 'literal1 literal2 literal3 literal literal4');
|
||||
});
|
||||
|
||||
test('compound property attribute with {} in text', function() {
|
||||
var el = document.createElement('x-basic');
|
||||
|
||||
assert.equal(el.$.boundChild.getAttribute('compoundAttr3'), 'Hello {0} username world')
|
||||
})
|
||||
|
||||
test('compound adjacent textNode bindings', function() {
|
||||
var el = document.createElement('x-basic');
|
||||
// The single space is due to the gambit to prevent empty text nodes
|
||||
|
Loading…
Reference in New Issue
Block a user