source: trunk/j/src/bsh/commands/super.bsh @ 2

Last change on this file since 2 was 2, checked in by piso, 18 years ago

Initial checkin.

File size: 372 bytes
Line 
1
2bsh.help.super = "usage: super( methodname )";
3
4/**
5  This implementation of this is fragile...
6*/
7bsh.This super( String scope ) {
8  n=this.caller.namespace;
9  while ( n != global ) {
10    if ( n.namespace.getName().equals( "Method NameSpace: "+ scope ) )
11      return n;
12    else
13      n=n.super;
14  }
15  if ( n == global)
16    throw new EvalError("Enclosing scope not found: "+scope);
17}
18
Note: See TracBrowser for help on using the repository browser.