Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use functions in expressions #57

Closed
davidpadbury opened this issue Jan 28, 2011 · 4 comments
Closed

Unable to use functions in expressions #57

davidpadbury opened this issue Jan 28, 2011 · 4 comments

Comments

@davidpadbury
Copy link

It's debatable whether we should be able to do this in the first place, but I found that creating functions in expressions will throw an error.

${sum(records, function(r) { return r.value; })}

The above produces the error "Uncaught SyntaxError: Unexpected token )". See this issue reproduced at http://jsfiddle.net/VPvDG/.

Affects 1.0.0pre.

@BorisMoore
Copy link
Owner

Yes, not sure we want to support this. I will look into it when we implement some changes around Beta2

@mikesamuel
Copy link

The unabbreviated syntax {{=sum(recorde, function (r) { return r.value; })}} should address your need.

@BorisMoore
Copy link
Owner

Yes, correct, using {{= expression}}, which is semantically equivalent to ${expression}, should allow using expressions that include } characters...
I missed that when I replied earlier...

@davidpadbury
Copy link
Author

Good catch - cheers guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants