From e822616b06afe61572f6280401d3e3366bd7fbd5 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Mon, 24 Nov 2014 13:40:05 -0200 Subject: [PATCH] jshint --- meta/crx/vapi-client.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/meta/crx/vapi-client.js b/meta/crx/vapi-client.js index 69be8f952..8fa7b07f8 100644 --- a/meta/crx/vapi-client.js +++ b/meta/crx/vapi-client.js @@ -21,6 +21,8 @@ // For non background pages +/* global self, chrome, vAPI */ + /******************************************************************************/ (function() { @@ -39,11 +41,15 @@ var messagingConnector = function(response) { return; } + var channels = vAPI.messaging.channels; var channel, listener; if ( response.broadcast === true ) { - for ( channel in vAPI.messaging.channels ) { - listener = vAPI.messaging.channels[channel].listener; + for ( channel in channels ) { + if ( channels.hasOwnProperty(channel) === false ) { + continue; + } + listener = channels[channel].listener; if ( typeof listener === 'function' ) { listener(response.msg); } @@ -58,7 +64,7 @@ var messagingConnector = function(response) { } if ( !listener ) { - channel = vAPI.messaging.channels[response.portName]; + channel = channels[response.portName]; listener = channel && channel.listener; }