[ 
https://issues.apache.org/jira/browse/THRIFT-2594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Thomas Lazar updated THRIFT-2594:
---------------------------------

    Attachment: thrift-2594-add-single-quote-for-escaping-to-jsgenerator.patch

Patch adds single quote to {{escape_}} map in the {{t_js_generator}} 
constructor.

> JS Compiler: Single quotes are not being escaped in constants. 
> ---------------------------------------------------------------
>
>                 Key: THRIFT-2594
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2594
>             Project: Thrift
>          Issue Type: Bug
>          Components: JavaScript - Compiler
>    Affects Versions: 0.9.1
>         Environment: Windows 7
>            Reporter: Thomas Lazar
>         Attachments: 
> thrift-2594-add-single-quote-for-escaping-to-jsgenerator.patch
>
>
> If you define a constant containing single quotes in the thrift IDL the 
> resulting JS constants are not properly escaped.
> Example: 
> {code:title=test.thrift}
> const string test = "blah ' blub '' blahblahblubberblub''''''''"
> {code}
> gets compiled into 
> {code:title=test_types.js}
> test = 'blah ' blub '' blahblahblubberblub''''''''';
> {code}
> instead it should result in
> {code:title=test_types.js - new}
> test = 'blah \' blub \'\' blahblahblubberblub\'\'\'\'\'\'\'\'';
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to