chore: minor code style tweak
This commit is contained in:
parent
fbf4d27cd4
commit
5d1d247491
@ -213,8 +213,8 @@ class Ads {
|
||||
request.setAdWillPlayMuted(!this.player.muted);
|
||||
|
||||
this.loader.requestAds(request);
|
||||
} catch (e) {
|
||||
this.onAdError(e);
|
||||
} catch (error) {
|
||||
this.onAdError(error);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -72,7 +72,7 @@ class Plyr {
|
||||
(() => {
|
||||
try {
|
||||
return JSON.parse(this.media.getAttribute('data-plyr-config'));
|
||||
} catch (e) {
|
||||
} catch (_) {
|
||||
return {};
|
||||
}
|
||||
})(),
|
||||
|
@ -26,7 +26,7 @@ class Storage {
|
||||
window.localStorage.removeItem(test);
|
||||
|
||||
return true;
|
||||
} catch (e) {
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ const support = {
|
||||
|
||||
try {
|
||||
return Boolean(type && this.media.canPlayType(type).replace(/no/, ''));
|
||||
} catch (e) {
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
@ -184,13 +184,13 @@ const ui = {
|
||||
.call(this)
|
||||
// Load image
|
||||
.then(() => loadImage(poster))
|
||||
.catch((err) => {
|
||||
.catch((error) => {
|
||||
// Hide poster on error unless it's been set by another call
|
||||
if (poster === this.poster) {
|
||||
ui.togglePoster.call(this, false);
|
||||
}
|
||||
// Rethrow
|
||||
throw err;
|
||||
throw error;
|
||||
})
|
||||
.then(() => {
|
||||
// Prevent race conditions
|
||||
|
@ -31,7 +31,7 @@ export function repaint(element, delay) {
|
||||
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
element.hidden = false;
|
||||
} catch (e) {
|
||||
} catch (_) {
|
||||
// Do nothing
|
||||
}
|
||||
}, delay);
|
||||
|
@ -19,7 +19,7 @@ const supportsPassiveListeners = (() => {
|
||||
});
|
||||
window.addEventListener('test', null, options);
|
||||
window.removeEventListener('test', null, options);
|
||||
} catch (e) {
|
||||
} catch (_) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ export default function fetch(url, responseType = 'text') {
|
||||
if (responseType === 'text') {
|
||||
try {
|
||||
resolve(JSON.parse(request.responseText));
|
||||
} catch (e) {
|
||||
} catch (_) {
|
||||
resolve(request.responseText);
|
||||
}
|
||||
} else {
|
||||
@ -35,8 +35,8 @@ export default function fetch(url, responseType = 'text') {
|
||||
request.responseType = responseType;
|
||||
|
||||
request.send();
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ const isUrl = (input) => {
|
||||
|
||||
try {
|
||||
return !isEmpty(new URL(string).hostname);
|
||||
} catch (e) {
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
@ -20,7 +20,7 @@ export function parseUrl(input, safe = true) {
|
||||
|
||||
try {
|
||||
return new URL(url);
|
||||
} catch (e) {
|
||||
} catch (_) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user