@@ -199,14 +199,26 @@ Clazz.getClassName = function (clazzHost) {
199199 return "Array" ;
200200 }
201201 }
202- return Clazz . getClassName ( obj . constructor , true ) ;
202+ var depth = arguments [ 2 ] ;
203+ if ( depth == null ) {
204+ depth = 1 ;
205+ } else if ( depth >= 4 ) {
206+ return "Object" ;
207+ }
208+ return Clazz . getClassName ( obj . constructor , true , depth ++ ) ;
203209 }
204210 } else if ( objType == "number" ) {
205211 return "Number" ;
206212 } else if ( objType == "boolean" ) {
207213 return "Boolean" ;
208214 }
209- return Clazz . getClassName ( obj . constructor , true ) ;
215+ var depth = arguments [ 2 ] ;
216+ if ( depth == null ) {
217+ depth = 1 ;
218+ } else if ( depth >= 4 ) {
219+ return "Object" ;
220+ }
221+ return Clazz . getClassName ( obj . constructor , true , depth ++ ) ;
210222 }
211223 }
212224} ;
@@ -1586,7 +1598,7 @@ Clazz.instantialize = function (objThis, args) {
15861598/* protected */
15871599/*-# innerFunctionNames -> iFN #-*/
15881600Clazz . innerFunctionNames = [
1589- "equals" , "hashCode" , "toString" , "getName" , "getClassLoader" , "getResourceAsStream" /*# {$no.javascript.support} >>x #*/ , "defineMethod" , "defineStaticMethod" ,
1601+ "equals" , "hashCode" , "toString" , "getName" , "getSimpleName" , " getClassLoader", "getResourceAsStream" /*# {$no.javascript.support} >>x #*/ , "defineMethod" , "defineStaticMethod" ,
15901602 "makeConstructor" /*# x<< #*/
15911603] ;
15921604
@@ -1616,6 +1628,17 @@ Clazz.innerFunctions = {
16161628 getName : function ( ) {
16171629 return Clazz . getClassName ( this , true ) ;
16181630 } ,
1631+ // Similar to Class#getSimpleName
1632+ getSimpleName : function ( ) {
1633+ var name = Clazz . getClassName ( this , true ) ;
1634+ if ( name != null ) {
1635+ var idx = name . lastIndexOf ( "." ) ;
1636+ if ( idx != - 1 ) {
1637+ name = name . substring ( idx + 1 ) ;
1638+ }
1639+ }
1640+ return name ;
1641+ } ,
16191642
16201643 getClassLoader : function ( ) {
16211644 var clazzName = this . __CLASS_NAME__ ;
@@ -1802,6 +1825,7 @@ Clazz.decorateFunction = function (clazzFun, prefix, name) {
18021825 /*
18031826 clazzFun.equals = Clazz.innerFunctions.equals;
18041827 clazzFun.getName = Clazz.innerFunctions.getName;
1828+ clazzFun.getSimpleName = Clazz.innerFunctions.getSimpleName;
18051829 clazzFun.getResourceAsStream = Clazz.innerFunctions.getResourceAsStream;
18061830 */
18071831 var inF = Clazz . innerFunctionNames ;
0 commit comments