PageRenderTime 43ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/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
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  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. }