akdubya / dustjs

Asynchronous templates for the browser and node.js
http://akdubya.github.com/dustjs/
MIT License
1.44k stars 124 forks source link

"params" template doesn't work on the demo page #5

Closed semanticprogrammer closed 14 years ago

semanticprogrammer commented 14 years ago

{#helper foo="bar"/}

SyntaxError: missing ; before statement

akdubya commented 14 years ago

It's working for me on FF, Chrome & Safari. What's your browser & version?

semanticprogrammer commented 14 years ago

It doesn't work only with FF 4.0b6. With Chrome and FF 3.6 it's working. Sorry, I didn't expect that it will work with other browsers. I'm not sure if I should close the issue. Probably it makes sense to check why there is a problem with beta version of FF.

akdubya commented 14 years ago

Weird... this only happens the first time the params demo is rendered -- notice FF badly mangles the source in the context textarea. If you switch to another template and come back it works.

This is not a Dust issue but I'll poke around with Firebug Lite and see what's what.

semanticprogrammer commented 14 years ago

I can confirm your description of the situation. Switching to another template resolve the issue. You have a good chance to discover a mayor bug in FF 4 :)

akdubya commented 14 years ago

This is definitely a jsbeautify/FF issue. Copy the following into http://jsbeautifier.org:

{ "helper": function (chunk, context, bodies, params) { return chunk.write(params.foo); } }

Crazily enough, it mangles the result in 4.0b6, but only on the first attempt.

I'm going to close this for now. If the behavior persists as FF approaches a release candidate it probably makes sense to check with the jsbeautify folks.

semanticprogrammer commented 14 years ago

Thank you for taking issue seriously! By the way I believe the Dust is very advanced template engine and you have a real chance to make it number one template engine. I'm going to promote your pretty creation, as much as I can :)