Actually delete properties instead of just setting them as undefined.

This commit is contained in:
Luke Slater 2012-02-08 18:42:38 +00:00
parent 2fd09aa3f9
commit 846514e09f

4
run.js
View File

@ -56,12 +56,12 @@ DBot.prototype.reloadModules = function() {
this.save(); this.save();
var path = require.resolve('./snippets'); var path = require.resolve('./snippets');
require.cache[path] = undefined; delete require.cache[path];
require('./snippets'); require('./snippets');
this.moduleNames.each(function(name) { this.moduleNames.each(function(name) {
var cacheKey = require.resolve('./modules/' + name); var cacheKey = require.resolve('./modules/' + name);
require.cache[cacheKey] = undefined; // TODO: snippet to remove element properly delete require.cache[cacheKey];
try { try {
this.rawModules.push(require('./modules/' + name)); this.rawModules.push(require('./modules/' + name));
} catch(err) { } catch(err) {