diff --git a/zephyr/static/js/hotkey.js b/zephyr/static/js/hotkey.js index 0f9b8092f0..d74d67f77c 100644 --- a/zephyr/static/js/hotkey.js +++ b/zephyr/static/js/hotkey.js @@ -33,7 +33,7 @@ function simulate_keypress(keycode) { function process_hotkey(code) { var next_zephyr, window_to_scroll; - if (code in directional_hotkeys) { + if (directional_hotkeys.hasOwnProperty(code)) { next_zephyr = directional_hotkeys[code](selected_zephyr); if (next_zephyr.length !== 0) { select_zephyr(next_zephyr, true); @@ -95,7 +95,7 @@ var goto_hotkeys = { }; function process_goto_hotkey(code) { - if (code in goto_hotkeys) + if (goto_hotkeys.hasOwnProperty(code)) goto_hotkeys[code](); /* Always return to the initial hotkey mode, even diff --git a/zephyr/static/js/zephyr.js b/zephyr/static/js/zephyr.js index d0c80feddf..0510ccb7be 100644 --- a/zephyr/static/js/zephyr.js +++ b/zephyr/static/js/zephyr.js @@ -400,7 +400,7 @@ function add_messages(data) { // If we received the initially selected message, select it on the client side, // but not if the user has already selected another one during load. - if ((selected_zephyr_id === -1) && (initial_pointer in zephyr_dict)) { + if ((selected_zephyr_id === -1) && (zephyr_dict.hasOwnProperty(initial_pointer))) { select_and_show_by_id(initial_pointer); }