我有以下结构: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,你会如此善意解释你的投票? –