|
10 | 10 | // TODO: CharacterSequence does not implement Java 8 default methods chars() or codePoints() |
11 | 11 | // It is possible that these might be loaded dynamically. |
12 | 12 |
|
| 13 | +// BH 8/16/2018 3.2.2.04 fixes Character.toTitleCase$C, [Integer,Long,Short,Byte].toString(i,radix) |
13 | 14 | // BH 8/13/2018 3.2.2.04 $finals to $finals$ -- basically variables are $xxx, methods are xxx$, and special values are $xxx$ |
14 | 15 | // BH 8/12/2018 3.2.2 adding J2S.onClazzLoaded hook for Clazz loaded |
15 | 16 | // BH 8/11/2018 3.2.2 Clazz.newLambda removed |
@@ -98,7 +99,7 @@ window["j2s.clazzloaded"] = true; |
98 | 99 | _debugging: false, |
99 | 100 | _loadcore: true, |
100 | 101 | _nooutput: 0, |
101 | | - _VERSION: "3.2.2.03", |
| 102 | + _VERSION_R: "3.2.2.05", |
102 | 103 | _VERSION_T: "unknown", |
103 | 104 | }; |
104 | 105 |
|
@@ -3477,14 +3478,15 @@ var decorateAsNumber = function (clazz, qClazzName, type, PARAMCODE) { |
3477 | 3478 |
|
3478 | 3479 | decorateAsNumber(Integer, "Integer", "int", "I"); |
3479 | 3480 |
|
3480 | | -Integer.toString=Integer.toString$I=Integer.prototype.toString=function(){ |
3481 | | - if(arguments.length!=0){ |
3482 | | - return "" + arguments[0]; |
3483 | | - } |
3484 | | - if(this===Integer){ |
3485 | | - return "class java.lang.Integer"; |
3486 | | - } |
3487 | | - return "" + this.valueOf(); |
| 3481 | +Integer.toString=Integer.toString$I=Integer.toString$I$I=Integer.prototype.toString=function(i,radix){ |
| 3482 | + switch(arguments.length) { |
| 3483 | + case 2: |
| 3484 | + return i.toString(radix); |
| 3485 | + case 1: |
| 3486 | + return "" +i; |
| 3487 | + case 0: |
| 3488 | + return (this===Integer ? "class java.lang.Integer" : ""+this.valueOf()); |
| 3489 | + } |
3488 | 3490 | }; |
3489 | 3491 |
|
3490 | 3492 | m$(Integer, ["c$", "c$$S", "c$$I"], function(v){ |
@@ -3668,13 +3670,15 @@ if (typeof arguments[0] != "object")this.c$(arguments[0]); |
3668 | 3670 | }); |
3669 | 3671 |
|
3670 | 3672 | decorateAsNumber(Long, "Long", "long", "L"); |
3671 | | -Long.toString=Long.toString$J=Long.prototype.toString=function(){ |
3672 | | -if(arguments.length!=0){ |
3673 | | -return""+arguments[0]; |
3674 | | -}else if(this===Long){ |
3675 | | -return"class java.lang.Long"; |
3676 | | -} |
3677 | | -return""+this.valueOf(); |
| 3673 | +Long.toString=Long.toString$J=Long.toString$J$I = Long.prototype.toString=function(i, radix){ |
| 3674 | + switch(arguments.length) { |
| 3675 | + case 2: |
| 3676 | + return i.toString(radix); |
| 3677 | + case 1: |
| 3678 | + return "" +i; |
| 3679 | + case 0: |
| 3680 | + return (this===Long ? "class java.lang.Long" : ""+this.valueOf()); |
| 3681 | + } |
3678 | 3682 | }; |
3679 | 3683 |
|
3680 | 3684 | m$(Long, ["c$", "c$$S", "c$$J"], function(v){ |
@@ -3742,13 +3746,15 @@ function (v,radix) { |
3742 | 3746 | this.valueOf = function () {return v;}; |
3743 | 3747 | }, 1); |
3744 | 3748 |
|
3745 | | -Short.toString = Short.prototype.toString = function () { |
3746 | | - if (arguments.length != 0) { |
3747 | | - return "" + arguments[0]; |
3748 | | - } else if (this === Short) { |
3749 | | - return "class java.lang.Short"; // Short.class.toString |
3750 | | - } |
3751 | | - return "" + this.valueOf(); |
| 3749 | +Short.toString = Short.toString$H = Short.toString$H$I = Short.prototype.toString = function (i,radix) { |
| 3750 | + switch(arguments.length) { |
| 3751 | + case 2: |
| 3752 | + return i.toString(radix); |
| 3753 | + case 1: |
| 3754 | + return "" +i; |
| 3755 | + case 0: |
| 3756 | + return (this===Short ? "class java.lang.Short" : ""+this.valueOf()); |
| 3757 | + } |
3752 | 3758 | }; |
3753 | 3759 |
|
3754 | 3760 | Short.MIN_VALUE = Short.prototype.MIN_VALUE = -32768; |
@@ -3804,13 +3810,15 @@ this.valueOf=function(){return v;}; |
3804 | 3810 | this.byteValue = function(){return v}; |
3805 | 3811 | }, 1); |
3806 | 3812 |
|
3807 | | -Byte.toString=Byte.toString$B=Byte.prototype.toString=function(){ |
3808 | | -if(arguments.length!=0){ |
3809 | | -return""+arguments[0]; |
3810 | | -}else if(this===Byte){ |
3811 | | -return"class java.lang.Byte"; |
3812 | | -} |
3813 | | -return""+this.valueOf(); |
| 3813 | +Byte.toString=Byte.toString$B=Byte.toString$B$I=Byte.prototype.toString=function(i,radix){ |
| 3814 | + switch(arguments.length) { |
| 3815 | + case 2: |
| 3816 | + return i.toString(radix); |
| 3817 | + case 1: |
| 3818 | + return "" +i; |
| 3819 | + case 0: |
| 3820 | + return (this===Byte ? "class java.lang.Byte" : ""+this.valueOf()); |
| 3821 | + } |
3814 | 3822 | }; |
3815 | 3823 |
|
3816 | 3824 | Byte.serialVersionUID=Byte.prototype.serialVersionUID=-7183698231559129828; |
@@ -4788,7 +4796,7 @@ return(""+c).toLowerCase().charAt(0); |
4788 | 4796 | }, 1); |
4789 | 4797 | m$(C$,"toTitleCase$C", |
4790 | 4798 | function(c){ |
4791 | | - return Character.toUpperCase(c); |
| 4799 | + return Character.toUpperCase$C(c); |
4792 | 4800 | }, 1); |
4793 | 4801 | m$(C$,"toUpperCase$C", |
4794 | 4802 | function(c){ |
|
0 commit comments