Inconsistent (?) handling of strings #2169

paulmillr opened this Issue Mar 3, 2012 · 3 comments

5 participants

a 'b c'
a "b c"

a('b c');

a("b c");


a 'b 
a "b 

a('b \

a("b c");

Notice \. Does this work as expected?


Well, it'll work in the sense that the line continuation character does the right thing there; inherited from the C preprocessor, in JS that has always let you split a string across lines without actually ending up with the \n in the string. The slash in effect consumes the rest of the line.

It's odd that the compiler produces both kinds of output though. Legacy stuff? Maybe part of the recent shuffling to get the line numbers a little closer between coffee and js?


The output is inconsistent in terms of formatting, but as @csubagio points out, the two are semantically equivalent. "Bug" seems like too strong a word, though this probably isn't intentional.


This has been fixed in 1.7.

@vendethiel vendethiel closed this Mar 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment