Skip to content

Commit 9b6848e

Browse files
committed
Byte.parseByte
1 parent 11d528f commit 9b6848e

File tree

1 file changed

+14
-23
lines changed

1 file changed

+14
-23
lines changed

sources/net.sf.j2s.java.core/srcjs/js/j2sClazz.js

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
// TODO: still a lot of references to window[...]
1111

12+
// BH 2019.10.30 Foo.parseFoo not Foo.parseFooRadix
1213
// BH 2019.10.26 subclass def should exclude __PARAMCODE
1314
// BH 2019.09.24 missing isArray$() in Integer.class
1415
// BH 2019.09.26 superfast byte[] -> String using TextDecoder
@@ -3469,7 +3470,7 @@ Integer.toString=Integer.toString$I=Integer.toString$I$I=Integer.prototype.toStr
34693470
m$(Integer, ["c$", "c$$S", "c$$I"], function(v){
34703471
v == null && (v = 0);
34713472
if (typeof v != "number")
3472-
v = Integer.parseIntRadix$S$I(v, 10);
3473+
v = Integer.parseInt$S$I(v, 10);
34733474
v = v.intValue();
34743475
this.valueOf=function(){return v;};
34753476
}, 1);
@@ -3552,7 +3553,7 @@ m$(Integer,"numberOfTrailingZeros$I",
35523553

35533554
var radixChar = "0123456789abcdefghijklmnopqrstuvwxyz";
35543555

3555-
m$(Integer,"parseIntRadix$S$I",
3556+
m$(Integer,"parseInt$S$I",
35563557
function(s,radix){
35573558
var v = parseInt(s, radix);
35583559
if (isNaN(v)){
@@ -3561,9 +3562,9 @@ function(s,radix){
35613562
return v;
35623563
}, 1);
35633564

3564-
m$(Integer,["parseInt$S","parseInt$S$I"],
3565+
m$(Integer,["parseInt$S"],
35653566
function(s,radix){
3566-
return Integer.parseIntRadix$S$I(s, radix || 10);
3567+
return Integer.parseInt$S$I(s, radix || 10);
35673568
}, 1);
35683569

35693570
m$(Integer,["valueOf$S","valueOf$I"],
@@ -3573,7 +3574,7 @@ function(s, radix){
35733574

35743575
m$(Integer,["valueOf$S$I"],
35753576
function(s, radix){
3576-
return Integer.parseIntRadix$S$I(s, radix || 10);
3577+
return Integer.parseInt$S$I(s, radix || 10);
35773578
}, 1);
35783579

35793580
m$(Integer,"equals$O",
@@ -3638,7 +3639,7 @@ Long.toString=Long.toString$J=Long.toString$J$I = Long.prototype.toString=functi
36383639

36393640
m$(Long, ["c$", "c$$S", "c$$J"], function(v){
36403641
v == null && (v = 0);
3641-
v = (typeof v == "number" ? Math.round(v) : Integer.parseIntRadix$S$I(v, 10));
3642+
v = (typeof v == "number" ? Math.round(v) : Integer.parseInt$S$I(v, 10));
36423643
this.valueOf=function(){return v;};
36433644
}, 1);
36443645

@@ -3648,7 +3649,7 @@ m$(Long, ["c$", "c$$S", "c$$J"], function(v){
36483649

36493650
m$(Long,["parseLong$S", "parseLong$S$I"],
36503651
function(s,radix){
3651-
return Integer.parseIntRadix$S$I(s, radix || 10);
3652+
return Integer.parseInt$S$I(s, radix || 10);
36523653
}, 1);
36533654

36543655
m$(Long,["valueOf$S","valueOf$J","valueOf$S$I"],
@@ -3692,7 +3693,7 @@ m$(Short, ["c$", "c$$S", "c$$H"],
36923693
function (v,radix) {
36933694
v == null && (v = 0);
36943695
if (typeof v != "number")
3695-
v = Integer.parseIntRadix$S$I(v, radix||10);
3696+
v = Integer.parseInt$S$I(v, radix||10);
36963697
v = v.shortValue();
36973698
this.valueOf = function () {return v;};
36983699
}, 1);
@@ -3712,13 +3713,8 @@ Short.MIN_VALUE = Short.prototype.MIN_VALUE = -32768;
37123713
Short.MAX_VALUE = Short.prototype.MAX_VALUE = 32767;
37133714
//Short.TYPE = Short.prototype.TYPE = Short;
37143715

3715-
m$(Short, "parseShortRadix$S$I",function (s, radix) {
3716-
return Integer.parseIntRadix$S$I(s, radix).shortValue();
3717-
}, 1);
3718-
3719-
3720-
m$(Short, "parseShort$S",function (s) {
3721-
return Short.parseShortRadix$S$I(s, 10);
3716+
m$(Short, ["parseShort$S", "parseShort$S$I"],function (s, radix) {
3717+
return Integer.parseInt$S$I(s, radix || 10).shortValue();
37223718
}, 1);
37233719

37243720
m$(Short, ["valueOf$S","valueOf$H","valueOf$S$I"],
@@ -3755,7 +3751,7 @@ decorateAsNumber(Byte,"Byte", "byte", "B");
37553751

37563752
m$(Byte, ["c$", "c$$S", "c$$B"], function(v,radix){
37573753
if (typeof v != "number")
3758-
v = Integer.parseIntRadix$S$I(v, radix||10);
3754+
v = Integer.parseInt$S$I(v, radix||10);
37593755
v = v.byteValue();
37603756
this.valueOf=function(){return v;};
37613757
this.byteValue = function(){return v};
@@ -3778,14 +3774,9 @@ Byte.MAX_VALUE=Byte.prototype.MAX_VALUE=127;
37783774
Byte.SIZE=Byte.prototype.SIZE=8;
37793775
//Byte.TYPE=Byte.prototype.TYPE=Byte;
37803776

3781-
m$(Byte,"parseByteRadix$S$I",
3777+
m$(Byte,["parseByte$S", "parseByte$S$I"],
37823778
function(s,radix){
3783-
return Integer.parseIntRadix$S$I(s, radix).byteValue$();
3784-
}, 1);
3785-
3786-
m$(Byte,"parseByte$S",
3787-
function(s){
3788-
return Byte.parseByteRadix$S$I(s,10);
3779+
return Integer.parseInt$S$I(s, radix || 10).byteValue$();
37893780
}, 1);
37903781

37913782
m$(Byte, ["valueOf$S","valueOf$B","valueOf$S$I"],

0 commit comments

Comments
 (0)