From bde31a54c71a8ab9b5a29aa595967b7f70009ae6 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sat, 4 Aug 2018 02:04:24 -0400 Subject: [PATCH] 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 --- frontend_tests/node_tests/bot_data.js | 2 +- frontend_tests/node_tests/dispatch.js | 2 +- static/js/bot_data.js | 2 +- static/js/server_events_dispatch.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend_tests/node_tests/bot_data.js b/frontend_tests/node_tests/bot_data.js index c053f3fdc8..d508e9816a 100644 --- a/frontend_tests/node_tests/bot_data.js +++ b/frontend_tests/node_tests/bot_data.js @@ -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); }()); diff --git a/frontend_tests/node_tests/dispatch.js b/frontend_tests/node_tests/dispatch.js index 005e03f0b2..8d16455565 100644 --- a/frontend_tests/node_tests/dispatch.js +++ b/frontend_tests/node_tests/dispatch.js @@ -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'); diff --git a/static/js/bot_data.js b/static/js/bot_data.js index 4c1c655783..bc2d51a39d 100644 --- a/static/js/bot_data.js +++ b/static/js/bot_data.js @@ -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(); diff --git a/static/js/server_events_dispatch.js b/static/js/server_events_dispatch.js index 88f74cc8f6..a3fa46202d 100644 --- a/static/js/server_events_dispatch.js +++ b/static/js/server_events_dispatch.js @@ -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')) {