gwt /
gwt /
8a1fd63f99fd97a1cbdb61dbd25a98813f0e5c89 Modifed checks for extracting float values from JavaScript code in hosted
mode. The basic problem was that the value could be slightly changed by
the JavaScript code as a double, which meant that it would no longer compare
equal to the original value and might be slightly outside the range of the
check.
This was fixed by first looking for differences between MIN_VALUE and the
passed value to be too small to represent in a float -- if that is the case,
Float.MIN_VALUE is used instead of the returned value. Second, instead of
doing range checking we simply let the JVM do the work by casting to float.
After the cast, we check to see if the double value was not infinite and the
float value is, which means that an overflow occurred and a value larger
than Float.MAX_VALUE was changed to infinity by the cast. We treat this as
an error since data was lost, and throw HostedModeException to signal that
behavior could be different in web mode.
Review by: mmendez
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@665 8db76d5a-ed1c-0410-87a9-c151d255dfc7
2 files changed