I'm trying to get CoffeeKup to work with Mozilla's Rhino engine. Not much luck so far. I'm trying this simple template:
templates ?= {}
templates.first = ->
doctype 5
html ->
head ->
title "#{@title}"
body ->
h1 "#{@hello}"
Which I compile into Javascript and then try to render using
CoffeeKup.render(templates.first, {title: 'Say Hello', hello: 'Hello World!'});
But it fails with this:
org.mozilla.javascript.EcmaError: SyntaxError: invalid return (CoffeeKup#304(Function)#230)
In the Javascript version of coffeekup.coffee, line 304 is this one:
return new Function('data', code);
And code
line 230 (last line) is this:
).call(data);return __ck.buffer.join('');
Does anything look out of the ordinary or is this perhaps a Rhino bug?
Hello World!
`, so the code appears to be fine. – nilskp Jan 04 '12 at 15:08