Replace 'in' with .hasOwnProperty

(imported from commit 209aef184f0a6117d1c14e755e7b916a866b8702)
This commit is contained in:
Keegan McAllister
2012-10-04 01:27:53 -04:00
parent bdf1e7e25c
commit fcfcf834a1
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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);
}