branaway / Japid

A Java-based statically-typed fast template engine that can be used in any Java code. It has special adapter for use with the Play! Framework.
113 stars 18 forks source link

Removed an invalid semicolon at the end of the jsAction funcPattern. #41

Closed mikenikles closed 12 years ago

mikenikles commented 12 years ago

Hi,

There seems to be an invalid semicolon that causes javascript exceptions. In particular, "Uncaught SyntaxError: Unexpected token ;"

Cheers,

Mike

branaway commented 12 years ago

Thanks Mike. I thought it was harmless. Care to show a snippet that shows the problem?

mikenikles commented 12 years ago

Sure, I've got a _routes.html tag in _tags. It follows the suggestion found at http://stackoverflow.com/questions/4209420/play-framework-best-practice-to-use-urls-in-separate-javascript-files.

With the semicolon in place, I got the following js output:

var routes = {
  indexRoute:  function(options) { var pattern = '/'; for(key in options) { pattern = pattern.replace(':'+key, options[key]); } return pattern; };,
  anotherRoute:  function(options) { var pattern = '/another'; for(key in options) { pattern = pattern.replace(':'+key, options[key]); } return pattern; };
}

Cheers,

Mike

branaway commented 12 years ago

It's obvious. Thanks Mike!

2012/1/18 Agile Consulting < reply@reply.github.com

Sure, I've got a _routes.html tag in _tags. It follows the suggestion found at http://stackoverflow.com/questions/4209420/play-framework-best-practice-to-use-urls-in-separate-javascript-files .

With the semicolon in place, I got the following js output:

var routes = {
 indexRoute:  function(options) { var pattern = '/'; for(key in options) {
pattern = pattern.replace(':'+key, options[key]); } return pattern; };,
 anotherRoute:  function(options) { var pattern = '/another'; for(key in
options) { pattern = pattern.replace(':'+key, options[key]); } return
pattern; };
}

Cheers,

Mike


Reply to this email directly or view it on GitHub: https://github.com/branaway/Japid/pull/41#issuecomment-3533393