super.bsh
来自「用java 编写的源码开放的文本编辑器。有很多有用的特性」· BSH 代码 · 共 43 行
BSH
43 行
/** Returns a bsh This reference to the enclosing scope (method scope) of the specified name. e.g. <p> <pre> foo() { x=1; bar() { x=2; gee() { x=3; print( x ); // 3 print( super.x ); // 2 print( super("foo").x ); // 1 } } } </pre> <p> This is an experimental command that is not intended to be of general use. <p> @method This super( String scopename )*/bsh.help.super = "usage: super( methodname )";// The implementation of this command is very fragilesuper( 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);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?