Skip to content

Commit

Permalink
Fix for method parsing in computed binding
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc committed Nov 13, 2015
1 parent 98acb3a commit c2e43d3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/standard/effectBuilder.html
Expand Up @@ -185,7 +185,7 @@
// method expressions are of the form: `name([arg1, arg2, .... argn])`
_parseMethod: function(expression) {
// tries to match valid javascript property names
var m = expression.match(/([^\s]+)\((.*)\)/);
var m = expression.match(/([^\s]+?)\((.*)\)/);
if (m) {
var sig = { method: m[1], static: true };
if (m[2].trim()) {
Expand Down
1 change: 1 addition & 0 deletions test/unit/bind-elements.html
Expand Up @@ -37,6 +37,7 @@
<span id="boundText">{{text}}</span>
<span idtest id="{{boundId}}"></span>
<s id="computedContent">{{computeFromTrickyLiterals(3, 'tricky\,\'zot\'')}}</s>
<s id="computedContent2">{{computeFromTrickyLiterals("(",3)}}</s>
<input id="boundInput" value="{{text::input}}">
<div id="compound1">{{cpnd1}}{{cpnd2}}{{cpnd3.prop}}{{computeCompound(cpnd4, cpnd5, 'literal')}}</div>
<div id="compound2">
Expand Down
1 change: 1 addition & 0 deletions test/unit/bind.html
Expand Up @@ -175,6 +175,7 @@
assert.equal(el.$.boundChild.computedFromTrickyLiterals, '3tricky,\'zot\'', 'Wrong result from tricky literal arg computation');
assert.equal(el.$.boundChild.computedFromTrickyLiterals2, '3tricky,\'zot\'', 'Wrong result from tricky literal arg computation');
assert.equal(el.$.computedContent.textContent, '3tricky,\'zot\'', 'Wrong textContent from tricky literal arg computation');
assert.equal(el.$.computedContent2.textContent, '(3', 'Wrong textContent from tricky literal arg computation');
});

test('computed annotation with no args', function() {
Expand Down

0 comments on commit c2e43d3

Please sign in to comment.