Change bargull-20110413-ivu by bargull@Bargull02 on 2011-04-13 18:28:38
in /home/anba/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: ToString and ToNumber bugs in compile-time evaluator
Bugs Fixed: LPP-9893 (Compile time evaluator returns wrong results for
ToString for Number type and ToNumber for String type)
Technical Reviewer: max
QA Reviewer: (pending)
Details:
JSNumber#stringValue()
- Double.toString() returns scientific notation for values less than
10^-3, but ToString [9.8.1] defines scientific notation should only be
used for values less than 10^-6 (same rules apply for range 10^7 to 10^21)
- Double.toString() uses 'E' in scientific notation, ES5 says 'e' should
be used
- Double.toString() doesn't emit '+' sign in scientific notation, ES5
requires '+' sign
- and Double.toString() returns invalid output for certain numbers, see
Java bug 4428022
JSString#numberValue()
- fixed bug in regular expression in order to allow '+' and '-' sign for
every decimal literal
- split regular expression into two capturing groups for decimal and
hex-integer literals
- add "p0" binary exponent for hex-integer literal when parsing the
number through Double.parseDouble()
Tests:
junit test case
Files:
M WEB-INF/lps/server/src/org/openlaszlo/sc/CompileTimeEvaluator_Test.java
M WEB-INF/lps/server/src/org/openlaszlo/sc/CompileTimeEvaluator.java
Changeset:
http://svn.openlaszlo.org/openlaszlo/patches/bargull-20110413-ivu.tar