/jEdit/tags/jedit-4-0-pre5/bsh/commands/super.bsh

# · Unknown · 18 lines · 15 code · 3 blank · 0 comment · 0 complexity · 21edb674864958df4e274cf93cb55e13 MD5 · raw file

  1. bsh.help.super = "usage: super( methodname )";
  2. /**
  3. This implementation of this is fragile...
  4. */
  5. bsh.This super( String scope ) {
  6. n=this.caller.namespace;
  7. while ( n != global ) {
  8. if ( n.namespace.getName().equals( "Method NameSpace: "+ scope ) )
  9. return n;
  10. else
  11. n=n.super;
  12. }
  13. if ( n == global)
  14. throw new EvalError("Enclosing scope not found: "+scope);
  15. }