jsx / JSX

JSX - a faster, safer, easier JavaScript
http://jsx.github.io/
MIT License
1.46k stars 102 forks source link

Escape sequence in native part is applied and resulting code will be broken. #311

Closed shibukawa closed 10 years ago

shibukawa commented 10 years ago

src:

import 'console.jsx';

native class Test {
    static const text : string;
} = '''
{
    text: '\r\n'
}
''';

class _Main {
    static function main(argv : string[]) : void {
        console.log(Test.text);
    }
}

result (only native part):

var Test$0 = 
{
    text: '
    '
};
kazuho commented 10 years ago

This is a spec. Multiline string literal understands escape sequences to be used within. And inline native definition uses the feature.

shibukawa commented 10 years ago

I thought again and I noticed the removing escape sequence is difficult.