File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
sources/net.sf.j2s.java.core/j2score Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,9 @@ Clazz.getClassName = function (clazzHost) {
6565 }
6666 var idx1 = idx0 + 8 ;
6767 var idx2 = clazzStr . indexOf ( "(" , idx1 ) ;
68+ if ( idx2 == - 1 ) {
69+ return "Object" ;
70+ }
6871 var clazzName = clazzStr . substring ( idx1 , idx2 )
6972 . replace ( / ^ \s + / , "" ) . replace ( / \s + $ / , "" ) ; // .trim ()
7073 if ( clazzName == "anonymous" ) {
@@ -91,6 +94,15 @@ Clazz.getClassName = function (clazzHost) {
9194 } else if ( obj . constructor == null ) {
9295 return "Object" ; // For HTML Element in IE
9396 } else {
97+ if ( obj . constructor . __CLASS_NAME__ == null ) {
98+ if ( obj instanceof Number ) {
99+ return "Number" ;
100+ } else if ( obj instanceof Boolean ) {
101+ return "Boolean" ;
102+ } else if ( obj instanceof Array ) {
103+ return "Array" ;
104+ }
105+ }
94106 return Clazz . getClassName ( obj . constructor ) ;
95107 }
96108 } else if ( objType == "number" ) {
You can’t perform that action at this time.
0 commit comments