just export the extras; don't attach them to the built-in fs module

This commit is contained in:
Jeff Williams 2013-05-02 19:59:17 -07:00
parent d78b10a890
commit e0ffe52411

View File

@ -3,18 +3,12 @@
* @module jsdoc/fs * @module jsdoc/fs
*/ */
var fs = require('fs'); var fs = exports.fs = require('fs');
var vm = require('jsdoc/util/vm'); var vm = require('jsdoc/util/vm');
var hasOwnProp = Object.prototype.hasOwnProperty; // export the VM-specific implementations of the extra methods
// add the VM-specific implementations of the extra methods
// TODO: document extra methods here // TODO: document extra methods here
var extras = vm.getModule('fs'); var extras = vm.getModule('fs');
for (var func in extras) { Object.keys(extras).forEach(function(extra) {
if ( hasOwnProp.call(extras, func) ) { exports[extra] = extras[extra];
fs[func] = extras[func]; });
}
}
module.exports = fs;