我有以下結構:Node.js中的可繼承靜態方法?
第一個文件:
Base = function() {
};
Base.something = function() {
return "bla";
};
if (typeof module !== 'undefined' && "exports" in module) {
module.exports = Base;
}
第二個文件:
var
util = require('util'),
Base = require('./base.js');
FooBar = function() {
};
util.inherits(FooBar, Base);
但FooBar.something
是不確定的。我如何繼承node.js中的靜態方法?
親愛的downvoter,你會如此善意解釋你的投票? –