bot_data: Rename delete to del.

`delete` is a reserved keyword that would interfere with the migration
to an ES6 module.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
Anders Kaseorg 2018-08-04 02:04:24 -04:00 committed by Tim Abbott
parent b8839302c0
commit bde31a54c7
4 changed files with 4 additions and 4 deletions

View File

@ -104,7 +104,7 @@ run_test('test_basics', () => {
bot = bot_data.get(43);
assert.equal('Bot 1', bot.full_name);
assert(bot.is_active);
bot_data.delete(43);
bot_data.del(43);
bot = bot_data.get(43);
assert.equal(bot, undefined);
}());

View File

@ -1002,7 +1002,7 @@ with_overrides(function (override) {
event = event_fixtures.realm_bot__delete;
global.with_stub(function (bot_stub) {
global.with_stub(function (admin_stub) {
override('bot_data.delete', bot_stub.f);
override('bot_data.del', bot_stub.f);
override('settings_users.update_user_data', admin_stub.f);
dispatch(event);
var args = bot_stub.get_args('bot_id');

View File

@ -42,7 +42,7 @@ var bot_data = (function () {
send_change_event();
};
exports.delete = function bot_data__delete(bot_id) {
exports.del = function bot_data__del(bot_id) {
delete bots[bot_id];
delete services[bot_id];
send_change_event();

View File

@ -198,7 +198,7 @@ exports.dispatch_normal_event = function dispatch_normal_event(event) {
event.bot.is_active = false;
settings_users.update_user_data(event.bot.user_id, event.bot);
} else if (event.op === 'delete') {
bot_data.delete(event.bot.user_id);
bot_data.del(event.bot.user_id);
settings_users.update_user_data(event.bot.user_id, event.bot);
} else if (event.op === 'update') {
if (_.has(event.bot, 'owner_id')) {