From c2e43d3cec32730378b9892f30627db5b9227959 Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Tue, 18 Aug 2015 00:57:46 +0200 Subject: [PATCH] Fix for method parsing in computed binding --- src/standard/effectBuilder.html | 2 +- test/unit/bind-elements.html | 1 + test/unit/bind.html | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/standard/effectBuilder.html b/src/standard/effectBuilder.html index 81b40b1860..6e2b78ff62 100644 --- a/src/standard/effectBuilder.html +++ b/src/standard/effectBuilder.html @@ -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()) { diff --git a/test/unit/bind-elements.html b/test/unit/bind-elements.html index 0d1c535058..a24935d1c2 100644 --- a/test/unit/bind-elements.html +++ b/test/unit/bind-elements.html @@ -37,6 +37,7 @@ {{text}} {{computeFromTrickyLiterals(3, 'tricky\,\'zot\'')}} + {{computeFromTrickyLiterals("(",3)}}
{{cpnd1}}{{cpnd2}}{{cpnd3.prop}}{{computeCompound(cpnd4, cpnd5, 'literal')}}
diff --git a/test/unit/bind.html b/test/unit/bind.html index b281f8f5a5..dee09d7213 100644 --- a/test/unit/bind.html +++ b/test/unit/bind.html @@ -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() {