Inconsistent (?) handling of strings #2169

Closed
paulmillr opened this Issue Mar 3, 2012 · 3 comments

5 participants

@paulmillr
a 'b c'
a "b c"

a('b c');

a("b c");

and

a 'b 
c'
a "b 
c"

a('b \
c');

a("b c");

Notice \. Does this work as expected?

@csubagio

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?

@TrevorBurnham
Collaborator

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.

@lydell
Collaborator

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