/jEdit/tags/jedit-4-0-pre3/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
- bsh.help.super = "usage: super( methodname )";
- /**
- This implementation of this is fragile...
- */
- bsh.This super( String scope ) {
- n=this.caller.namespace;
- while ( n != global ) {
- if ( n.namespace.getName().equals( "Method NameSpace: "+ scope ) )
- return n;
- else
- n=n.super;
- }
- if ( n == global)
- throw new EvalError("Enclosing scope not found: "+scope);
- }