From 9542285e72df6f9c35f7f7be6ca181d7e2a3302e Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Wed, 22 Jun 2016 12:20:00 +0200 Subject: [PATCH] Lint --- js/cast.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/js/cast.js b/js/cast.js index d391c3e..67a2f20 100644 --- a/js/cast.js +++ b/js/cast.js @@ -1,17 +1,15 @@ /*global chrome*/ -/*jslint devel: true, browser: true */ +/*jslint browser: true */ var launchBtn, disabledBtn, stopBtn; -var session, currentMedia; +var session; function receiverListener(e) { 'use strict'; - console.log('receiverListener', e); + return (e === chrome.cast.ReceiverAvailability.AVAILABLE); } -function onMediaDiscovered(how, media) { +function onMediaDiscovered() { 'use strict'; - console.log('onMediaDiscovered', how); - currentMedia = media; if (launchBtn) { stopBtn.classList.remove('cast_hidden'); launchBtn.classList.add('cast_hidden'); @@ -40,7 +38,6 @@ function stopCast() { function onMediaError() { 'use strict'; - console.log('onMediaError'); stopCast(); } @@ -53,7 +50,7 @@ function onRequestSessionSuccess(e) { function onLaunchError(e) { 'use strict'; - console.log('onLaunchError', e.description); + throw e.description; } function launchCast() { @@ -74,9 +71,9 @@ function onInitSuccess() { } } -function onError() { +function onError(e) { 'use strict'; - console.log('onError'); + throw e.code; } function initializeCastApi() { @@ -90,7 +87,7 @@ function loadCastApi(loaded, errorInfo) { if (loaded) { initializeCastApi(); } else { - console.log(errorInfo); + throw errorInfo; } }