From 234090273e3553825c3c541205534da9d55f8cb2 Mon Sep 17 00:00:00 2001 From: tsadlerBBC Date: Thu, 11 Jun 2015 13:13:06 +0100 Subject: [PATCH 1/2] Added "parent" to .jshintrc so that sagemcom.js exit strategy will pass jshint --- .jshintrc | 3 ++- gruntfile.js | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.jshintrc b/.jshintrc index 00d4b359..23934b8f 100644 --- a/.jshintrc +++ b/.jshintrc @@ -20,7 +20,8 @@ "history": true, "unescape": true, "ActiveXObject": true, - "DOMParser": true + "DOMParser": true, + "parent": true }, "asi": true, "laxbreak": true, diff --git a/gruntfile.js b/gruntfile.js index 3d19a3ab..5adeccd9 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -12,8 +12,7 @@ module.exports = function (grunt) { 'static/script/lib/*', 'static/script/devices/googletv.js', 'static/script/devices/data/json2.js', - 'static/script/widgets/horizontalcarousel.js', - 'static/script/devices/exit/sagemcom.js' + 'static/script/widgets/horizontalcarousel.js' ] } }, From f6dddb2ab98f3fcd0eb514b2b93f938bb7c1712c Mon Sep 17 00:00:00 2001 From: tsadlerBBC Date: Thu, 11 Jun 2015 13:44:01 +0100 Subject: [PATCH 2/2] 'parent' added as a JSHint directive in sagemcom.js and removed from .jshintrc, as 'parent' will not necessarily always be global --- .jshintrc | 3 +-- static/script/devices/exit/sagemcom.js | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.jshintrc b/.jshintrc index 23934b8f..00d4b359 100644 --- a/.jshintrc +++ b/.jshintrc @@ -20,8 +20,7 @@ "history": true, "unescape": true, "ActiveXObject": true, - "DOMParser": true, - "parent": true + "DOMParser": true }, "asi": true, "laxbreak": true, diff --git a/static/script/devices/exit/sagemcom.js b/static/script/devices/exit/sagemcom.js index ca0faaa4..caba7a40 100644 --- a/static/script/devices/exit/sagemcom.js +++ b/static/script/devices/exit/sagemcom.js @@ -34,6 +34,7 @@ require.def( * Exits the application by singalling the application iframe can be closed */ Device.prototype.exit = function() { + /* global parent: true */ parent.postMessage("JS_EVENT_QUIT_THIRD_PARTY", "*"); }; }