rainforestapp / decaf

Coffeescript to ES.next transpiler. Now maintained over at
https://github.com/juliankrispel/decaf
MIT License
106 stars 10 forks source link

Use eval to evaluate string literals #139

Closed bouk closed 8 years ago

bouk commented 8 years ago

There are a lot of string literal issues that seem to stem from incorrect string escaping. This PR uses eval to make sure we get the proper value.

@lemonmade @juliankrispel

juliankrispel commented 8 years ago

awesome this has been a thorn in my eye for a while.

why eval, though, is there no other way?

bouk commented 8 years ago

JSON.parse would be another way, but then you have to translate single quotes to double quotes and such which is a pain. eval solves this quickly and easily

lemonmade commented 8 years ago

Awesome 👍

juliankrispel commented 8 years ago

thanks @bouk