📄 super.bsh
字号:
/** 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -