CoffeKup on Rhino

17 views
Skip to first unread message

nilskp

unread,
Dec 22, 2011, 9:26:10 AM12/22/11
to coff...@googlegroups.com
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 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 is attached, 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?
code.js

nilskp

unread,
Jan 2, 2012, 7:56:56 AM1/2/12
to coff...@googlegroups.com
I haven't really progressed on this, so any help, comments or otherwise, would be helpful.

Thanks.
Reply all
Reply to author
Forward
0 new messages