From d034fecc89809421fc198ed60d39debfacf20652 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Sat, 20 Jul 2019 20:33:44 -0500 Subject: [PATCH] Remove default arguments from function definitions --- assets/js/embed.js | 4 +++- assets/js/notifications.js | 4 +++- assets/js/watch.js | 9 ++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/assets/js/embed.js b/assets/js/embed.js index 16a79e73..d9af1f5b 100644 --- a/assets/js/embed.js +++ b/assets/js/embed.js @@ -1,4 +1,6 @@ -function get_playlist(plid, retries = 5) { +function get_playlist(plid, retries) { + if (retries == undefined) retries = 5; + if (retries <= 0) { console.log('Failed to pull playlist'); return; diff --git a/assets/js/notifications.js b/assets/js/notifications.js index 2ba0bbcc..fcfc01e7 100644 --- a/assets/js/notifications.js +++ b/assets/js/notifications.js @@ -1,6 +1,8 @@ var notifications, delivered; -function get_subscriptions(callback, retries = 5) { +function get_subscriptions(callback, retries) { + if (retries == undefined) retries = 5; + if (retries <= 0) { return; } diff --git a/assets/js/watch.js b/assets/js/watch.js index 2f027b1a..05e3b7e2 100644 --- a/assets/js/watch.js +++ b/assets/js/watch.js @@ -109,7 +109,8 @@ function number_with_separator(val) { return val; } -function get_playlist(plid, retries = 5) { +function get_playlist(plid, retries) { + if (retries == undefined) retries = 5; playlist = document.getElementById('playlist'); if (retries <= 0) { @@ -194,7 +195,8 @@ function get_playlist(plid, retries = 5) { xhr.send(); } -function get_reddit_comments(retries = 5) { +function get_reddit_comments(retries) { + if (retries == undefined) retries = 5; comments = document.getElementById('comments'); if (retries <= 0) { @@ -270,7 +272,8 @@ function get_reddit_comments(retries = 5) { xhr.send(); } -function get_youtube_comments(retries = 5) { +function get_youtube_comments(retries) { + if (retries == undefined) retries = 5; comments = document.getElementById('comments'); if (retries <= 0) {