public String self(TypeDeclaration decl){
  if (decl instanceof Constructor) {
    decl=(TypeDeclaration)decl.getContainer();
  }
  String name=JsUtils.escapeStringLiteral(decl.getName());
  if (decl.isShared() || decl.isToplevel()) {
    name+=nestingSuffix(decl,true);
  }
 else {
    name="$" + Long.toString(getUID(decl),36);
  }
  return String.format("%c%s$",Character.toLowerCase(name.charAt(0)),name.substring(1));
}

public String self ( TypeDeclaration decl ) { if ( decl instanceof Constructor ) { decl = ( TypeDeclaration ) decl . getContainer ( ) ; } String name = JsUtils . escapeStringLiteral ( decl . getName ( ) ) ; if ( decl . isShared ( ) || decl . isToplevel ( ) ) { name += nestingSuffix ( decl , true ) ; } else { name = "$" + Long . toString ( getUID ( decl ) , 36 ) ; } return String . format ( "%c%s$" , Character . toLowerCase ( name . charAt ( 0 ) ) , name . substring ( 1 ) ) ; }
determine the identifier to be used for the self variable of the given type .
