extend.bsh
来自「用java 编写的源码开放的文本编辑器。有很多有用的特性」· BSH 代码 · 共 51 行
BSH
51 行
/** Return a new object that is a child of the specified object. <strong> Note: this command will likely change along with a better inheritance mechanism for bsh in a future release.</strong> <p> extend() is like the object() command, which creates a new bsh scripted object, except that the namespace of the new object is a child of the parent object. <p> For example: <p> <pre> foo=object(); bar=extend(foo); is equivalent to: foo() { bar() { return this; } } foo=foo(); bar=foo.bar(); and also: foo=object(); bar=object(); bar.namespace.bind( foo.namespace ); </pre> <p> The last example above is exactly what the extend() command does. In each case the bar object inherits variables from foo in the usual way. @method This extend( This object )*/bsh.help.extend= "usage: extend( This parent )";extend( bsh.This parent ) { this.namespace.setParent( parent.namespace ); return this; }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?