Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Apache FlexJS 0.5.0
-
None
Description
String literals containing escaped quotes and unicode characters compile incorrectly.
AS input:
public static function test1():String { return " ' \" "; } public static function test2():String { return ' \' " '; } public static function test3():String { return "\u2028"; }
Incorrect JS output:
WeaveTest.test1 = function() { return " ' " "; }; WeaveTest.test2 = function() { return ' ' " '; }; WeaveTest.test3 = function() { return " "; };
Error messages:
Dec 11, 2015 3:23:30 PM com.google.javascript.jscomp.LoggerErrorManager println SEVERE: C:\Weave\WeaveJS\bin\js-debug\WeaveTest.js:74: ERROR - Parse error. Unterminated string literal return " ' " "; ^ Dec 11, 2015 3:27:44 PM com.google.javascript.jscomp.LoggerErrorManager println SEVERE: C:\Weave\WeaveJS\bin\js-debug\WeaveTest.js:74: ERROR - Parse error. Unterminated string literal return ' ' " '; ^ Dec 11, 2015 2:27:32 PM com.google.javascript.jscomp.LoggerErrorManager println SEVERE: /home/pkovac/Source/Weave/WeaveJS/bin/js-debug/weavejs/util/StandardLib.js:313: ERROR - Parse error. Unterminated string literal return " ";
That last error only appears when building on Linux.
It looks like the offending code is getStringLiteralContent() in JSGeneratingReducer.java: