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