ollym / parrot

A lightning fast and lightweight templating engine for Node.js
38 stars 7 forks source link

Issue with using double quotes on sandboxed function params #3

Closed johnnypez closed 11 years ago

johnnypez commented 12 years ago

I'm seeing this odd issue, hopefully someone can confirm it.

A - This Fails

SyntaxError: Unexpected token ILLEGAL parrot/index.js:165

var data = "<%= foo(\"bar\") %>";

var view = {
  foo: function(str){ return x(str) }
}

parrot.render(data, {sandbox:view})

B - This Works

var data = "<%= foo('bar') %>";

var view = {
  foo: function(str){ return x(str) }
}

parrot.render(data, {sandbox:view})

B works when I encapsulate the function param 'bar' with single quotes instead of double quotes.

Can anyone else reproduce this?

e2b commented 11 years ago

duplicated in #7, resolved in #8