Skip to content

Commit c2e43d3

Browse files
committed
Fix for method parsing in computed binding
1 parent 98acb3a commit c2e43d3

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/standard/effectBuilder.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@
185185
// method expressions are of the form: `name([arg1, arg2, .... argn])`
186186
_parseMethod: function(expression) {
187187
// tries to match valid javascript property names
188-
var m = expression.match(/([^\s]+)\((.*)\)/);
188+
var m = expression.match(/([^\s]+?)\((.*)\)/);
189189
if (m) {
190190
var sig = { method: m[1], static: true };
191191
if (m[2].trim()) {

test/unit/bind-elements.html

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
<span id="boundText">{{text}}</span>
3838
<span idtest id="{{boundId}}"></span>
3939
<s id="computedContent">{{computeFromTrickyLiterals(3, 'tricky\,\'zot\'')}}</s>
40+
<s id="computedContent2">{{computeFromTrickyLiterals("(",3)}}</s>
4041
<input id="boundInput" value="{{text::input}}">
4142
<div id="compound1">{{cpnd1}}{{cpnd2}}{{cpnd3.prop}}{{computeCompound(cpnd4, cpnd5, 'literal')}}</div>
4243
<div id="compound2">

test/unit/bind.html

+1
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@
175175
assert.equal(el.$.boundChild.computedFromTrickyLiterals, '3tricky,\'zot\'', 'Wrong result from tricky literal arg computation');
176176
assert.equal(el.$.boundChild.computedFromTrickyLiterals2, '3tricky,\'zot\'', 'Wrong result from tricky literal arg computation');
177177
assert.equal(el.$.computedContent.textContent, '3tricky,\'zot\'', 'Wrong textContent from tricky literal arg computation');
178+
assert.equal(el.$.computedContent2.textContent, '(3', 'Wrong textContent from tricky literal arg computation');
178179
});
179180

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

0 commit comments

Comments
 (0)