forked from GitHub/dbot
Actually delete properties instead of just setting them as undefined.
This commit is contained in:
parent
2fd09aa3f9
commit
846514e09f
4
run.js
4
run.js
@ -56,12 +56,12 @@ DBot.prototype.reloadModules = function() {
|
||||
this.save();
|
||||
|
||||
var path = require.resolve('./snippets');
|
||||
require.cache[path] = undefined;
|
||||
delete require.cache[path];
|
||||
require('./snippets');
|
||||
|
||||
this.moduleNames.each(function(name) {
|
||||
var cacheKey = require.resolve('./modules/' + name);
|
||||
require.cache[cacheKey] = undefined; // TODO: snippet to remove element properly
|
||||
delete require.cache[cacheKey];
|
||||
try {
|
||||
this.rawModules.push(require('./modules/' + name));
|
||||
} catch(err) {
|
||||
|
Loading…
Reference in New Issue
Block a user