BorisMoore/jsrender — pull request #14 by bea (2011-10-30 21:30:54+00:00)
Title: Bug fix on Syntax error when the last line in the template is code

When code is inserted within a template, if the last line of the template is code there is a syntax error and the template is not processed.
In buildTmplFunction, when the nodes are being processed and the code string is created, if the last line of the template is code and as such it contains {{*, at the end of the code string it is added "result+=", but that variable will not have any value as there is no more code nor template items.
Checking if it is really the last line before adding the string "result+=" avoids the syntax error.

In this example, there'd be a syntax error: