Andy Dufilie created FLEX-34989:
-----------------------------------
Summary: String literals cross-compile incorrectly
Key: FLEX-34989
URL: https://issues.apache.org/jira/browse/FLEX-34989
Project: Apache Flex
Issue Type: Bug
Components: Falcon, FlexJS
Affects Versions: Apache FlexJS 0.5.0
Reporter: Andy Dufilie
String literals containing escaped quotes and unicode characters compile
incorrectly.
AS input:
{code}
public static function test1():String {
return " ' \" ";
}
public static function test2():String {
return ' \' " ';
}
public static function test3():String {
return "\u2028";
}
{code}
Incorrect JS output:
{code}
WeaveTest.test1 = function() {
return " ' " ";
};
WeaveTest.test2 = function() {
return ' ' " ';
};
WeaveTest.test3 = function() {
return "
";
};
{code}
Error messages:
{code}
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 "
";
{code}
That last error only appears when building on Linux.
It looks like the offending code is getStringLiteralContent() in
JSGeneratingReducer.java:
https://github.com/apache/flex-falcon/blob/808fd1601a0228883b06d061d0f6bd101888284e/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSGeneratingReducer.java#L1865
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)