Assuming global variable exists #1

Открыто
открыт 2022-10-29 16:10:15 +00:00 пользователем Ghost · комментариев: 0
Ghost прокомментировал(а) 2022-10-29 16:10:15 +00:00

Your program assumes that the global variable exists, which it may not.

Please change if (global.localStorage) { to if (global && global.localStorage) { so apps that use this don't crash.

Your program assumes that the global variable exists, which it may not. Please change `if (global.localStorage) {` to `if (global && global.localStorage) {` so apps that use this don't crash.
Войдите, чтобы присоединиться к обсуждению.
Нет меток
1 участников
Уведомления
Срок выполнения
Срок выполнения не установлен.
Зависимости

Зависимостей нет.

Ссылка: coolaj86/local-storage.js#1
Описание отсутствует.