77
88// Google closure compiler cannot handle Clazz.new or Clazz.super
99
10+ // BH 2021.12.19 adds Double -0; fixes println(Double)
1011// BH 2021.12.15 default encoding for String.getBytes() should be utf-8.
1112// BH 2021.08.16 fix for Interface initializing its subclass with static initialization
1213// BH 2021.07.28 String.instantialize upgraded to use TextDecoder() if possible (not in MSIE)
@@ -3263,13 +3264,20 @@ ps.printf = ps.printf$S$OA = ps.format = ps.format$S$OA = function (f, args) {
32633264
32643265ps . flush$ = function ( ) { }
32653266
3266- ps . println = ps . println$ = ps . println$O = ps . println$ Z = ps . println$I = ps . println$S = ps . println$C = function ( s ) {
3267+ ps . println = ps . println$ = ps . println$Z = ps . println$I = ps . println$S = ps . println$C = function ( s ) {
32673268 s = ( typeof s == "undefined" ? "" : "" + s ) ;
32683269 checkTrace ( s ) ;
32693270 s = ( typeof s == "undefined" ? "\r\n" : s == null ? s = "null\r\n" : s + "\r\n" ) ;
32703271 f ( s ) ;
32713272} ;
32723273
3274+ ps . println$O = function ( s ) {
3275+ s = ( typeof s == "undefined" ? "" : s . toString ( ) ) ;
3276+ checkTrace ( s ) ;
3277+ s = ( typeof s == "undefined" ? "\r\n" : s == null ? s = "null\r\n" : s + "\r\n" ) ;
3278+ f ( s ) ;
3279+ } ;
3280+
32733281ps . println$J = function ( l ) { ps . println ( Long . $s ( l ) ) }
32743282ps . println$F = ps . println$D = function ( f ) { var s = "" + f ; ps . println ( s . indexOf ( "." ) < 0 && s . indexOf ( "Inf" ) < 0 ? s + ".0" : s ) } ;
32753283
@@ -5202,6 +5210,9 @@ function(n){
52025210} , 1 ) ;
52035211
52045212Clazz . _floatToString = function ( f ) {
5213+ if ( f === 0 ) {
5214+ return ( 1 / f == - Infinity ? "-0.0" : "0.0" ) ;
5215+ }
52055216 var check57 = ( Math . abs ( f ) >= 1e-6 && Math . abs ( f ) < 1e-3 ) ;
52065217 if ( check57 )
52075218 f /= 1e7 ;
@@ -5229,7 +5240,7 @@ var maxFloat = 3.4028235E38;
52295240var minFloat = - 3.4028235E38 ;
52305241
52315242m$ ( Float , "c$" , function ( v ) {
5232- v || v == null || v != v || ( v = 0 ) ;
5243+ v || v == null || v != v || ( v == 0 ) || ( v = 0 ) ;
52335244 if ( typeof v != "number" )
52345245 v = Float . parseFloat$S ( v ) ;
52355246 this . valueOf = function ( ) { return v ; }
@@ -5245,6 +5256,7 @@ m$(Float, "c$$S", function(v){
52455256} , 1 ) ;
52465257
52475258m$ ( Float , "c$$D" , function ( v ) {
5259+ v || ( v = 0 ) ;
52485260 v = ( v < minFloat ? - Infinity : v > maxFloat ? Infinity : v ) ;
52495261 this . valueOf = function ( ) { return v ; }
52505262} , 1 ) ;
@@ -5375,18 +5387,19 @@ return Clazz._floatToString(this.valueOf());
53755387} ;
53765388
53775389m$ ( Double , "c$$D" , function ( v ) {
5390+ v || ( v = 0 ) ;
53785391 this . valueOf = function ( ) { return v ; } ;
53795392} , 1 ) ;
53805393
53815394m$ ( Double , "c$" , function ( v ) {
5382- v || v == null || v != v || ( v = 0 ) ;
5395+ v || v == null || v != v || ( v == 0 ) || ( v = 0 ) ;
53835396 if ( typeof v != "number" )
53845397 v = Double . parseDouble$S ( v ) ;
53855398 this . valueOf = function ( ) { return v ; }
53865399} , 1 ) ;
53875400
53885401m$ ( Double , [ "c$$S" ] , function ( v ) {
5389- v || v == null || ( v = 0 ) ;
5402+ v || v == null || ( v == 0 ) || ( v = 0 ) ;
53905403if ( typeof v != "number" )
53915404 v = Double . parseDouble$S ( v ) ;
53925405this . valueOf = function ( ) { return v ; } ;
0 commit comments