Skip to content

Commit 04cf938

Browse files
author
zhourenjian
committed
Fixing bug#1844187: Number is an object in java, not in javascript
1 parent f70f0a9 commit 04cf938

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed

sources/net.sf.j2s.java.core/src/java/lang/Byte.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Clazz.load (["java.lang.Comparable", "$.Number"], "java.lang.Byte", null, functi
22
java.lang.Byte = Byte = function () {
33
Clazz.instantialize (this, arguments);
44
};
5-
Clazz.decorateAsType (Byte, "Byte", Number, Comparable);
5+
Clazz.decorateAsType (Byte, "Byte", Number, Comparable, null, true);
66
Byte.prototype.valueOf = function () { return 0; };
77
Byte.toString = Byte.prototype.toString = function () {
88
if (arguments.length != 0) {

sources/net.sf.j2s.java.core/src/java/lang/Class.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,20 +1719,20 @@ Clazz.declareAnonymous = function (prefix, name, clazzParent, interfacez,
17191719

17201720
/* protected */
17211721
Clazz.decorateAsType = function (clazzFun, qClazzName, clazzParent,
1722-
interfacez, parentClazzInstance) {
1722+
interfacez, parentClazzInstance, inheritClazzFuns) {
17231723
clazzFun.__CLASS_NAME__ = qClazzName;
17241724
//if (qClazzName != "String" && qClazzName != "Object"
17251725
// && qClazzName != "Number" && qClazzName != "Date") {
17261726
clazzFun.prototype.__CLASS_NAME__ = qClazzName;
17271727
//}
17281728
clazzFun.equals = Clazz.innerFunctions.equals;
17291729
clazzFun.getName = Clazz.innerFunctions.getName;
1730-
/*
1731-
for (var i = 0; i < Clazz.innerFunctionNames.length; i++) {
1732-
var methodName = Clazz.innerFunctionNames[i];
1733-
clazzFun[methodName] = Clazz.innerFunctions[methodName];
1730+
if (inheritClazzFuns) {
1731+
for (var i = 0; i < Clazz.innerFunctionNames.length; i++) {
1732+
var methodName = Clazz.innerFunctionNames[i];
1733+
clazzFun[methodName] = Clazz.innerFunctions[methodName];
1734+
}
17341735
}
1735-
*/
17361736
if (parentClazzInstance != null) {
17371737
Clazz.inheritClass (clazzFun, clazzParent, parentClazzInstance);
17381738
} else if (clazzParent != null) {

sources/net.sf.j2s.java.core/src/java/lang/Double.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Clazz.load (["java.lang.Comparable", "$.Number"], "java.lang.Double", null, func
22
java.lang.Double = Double = function () {
33
Clazz.instantialize (this, arguments);
44
};
5-
Clazz.decorateAsType (Double, "Double", Number, Comparable);
5+
Clazz.decorateAsType (Double, "Double", Number, Comparable, null, true);
66
Double.prototype.valueOf = function () { return 0; };
77
Double.toString = Double.prototype.toString = function () {
88
if (arguments.length != 0) {

sources/net.sf.j2s.java.core/src/java/lang/Float.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Clazz.load (["java.lang.Comparable", "$.Number"], "java.lang.Float", null, funct
22
java.lang.Float = Float = function () {
33
Clazz.instantialize (this, arguments);
44
};
5-
Clazz.decorateAsType (Float, "Float", Number, Comparable);
5+
Clazz.decorateAsType (Float, "Float", Number, Comparable, null, true);
66
Float.prototype.valueOf = function () { return 0; };
77
Float.toString = Float.prototype.toString = function () {
88
if (arguments.length != 0) {

sources/net.sf.j2s.java.core/src/java/lang/Integer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Clazz.load (["java.lang.Comparable", "$.Number"], "java.lang.Integer", null, fun
22
java.lang.Integer = Integer = function () {
33
Clazz.instantialize (this, arguments);
44
};
5-
Clazz.decorateAsType (Integer, "Integer", Number, Comparable);
5+
Clazz.decorateAsType (Integer, "Integer", Number, Comparable, null, true);
66
Integer.prototype.valueOf = function () { return 0; };
77
Integer.toString = Integer.prototype.toString = function () {
88
if (arguments.length != 0) {

sources/net.sf.j2s.java.core/src/java/lang/Long.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Clazz.load (["java.lang.Comparable", "$.Number"], "java.lang.Long", null, functi
22
java.lang.Long = Long = function () {
33
Clazz.instantialize (this, arguments);
44
};
5-
Clazz.decorateAsType (Long, "Long", Number, Comparable);
5+
Clazz.decorateAsType (Long, "Long", Number, Comparable, null, true);
66
Long.prototype.valueOf = function () { return 0; };
77
Long.toString = Long.prototype.toString = function () {
88
if (arguments.length != 0) {

sources/net.sf.j2s.java.core/src/java/lang/Number.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Clazz.load (["java.io.Serializable"], "java.lang.Number", null, function () {
22
java.lang.Number = Number;
3-
//Clazz.decorateAsType (Number, "Number", null, java.io.Serializable);
3+
//Clazz.decorateAsType (Number, "Number", null, java.io.Serializable, null, true);
44
Number.__CLASS_NAME__ = "Number";
55
Clazz.implementOf (Number, java.io.Serializable);
66
Number.equals = Clazz.innerFunctions.equals;

sources/net.sf.j2s.java.core/src/java/lang/Short.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Clazz.load (["java.lang.Comparable", "$.Number"], "java.lang.Short", null, funct
22
java.lang.Short = Short = function () {
33
Clazz.instantialize (this, arguments);
44
};
5-
Clazz.decorateAsType (Short, "Short", Number, Comparable);
5+
Clazz.decorateAsType (Short, "Short", Number, Comparable, null, true);
66
Short.prototype.valueOf = function () { return 0; };
77
Short.toString = Short.prototype.toString = function () {
88
if (arguments.length != 0) {

0 commit comments

Comments
 (0)