If a template includes the U+2028 ([line separator](http://www.fileformat.info/info/unicode/char/2028/index.htm)) character, JavaScriptCompiler.compile() will fail. Here's a fiddle that shows the problem: http://jsfiddle.net/9vYCX/ To fix this, a bunch of nasty unicode characters could be escaped prior to parsing using a [regex not unlike Douglas Crockford's from json2.js](https://github.com/douglascrockford/JSON-js/blob/master/json2.js#L195). Here's a fiddle with "the fix" http://jsfiddle.net/9vYCX/1/