diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-05-14 02:15:36 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-05-14 02:15:36 +0400 |
commit | a9d8533eb1bc50dcfa46b39f31a105a8b7cb1815 (patch) | |
tree | bd412bcd59fd4618a0e48d95e41c6ea2caaf7593 /js | |
parent | 97f571adc55e3caa191ea9adb6b30cf5015071e1 (diff) |
refs #5049 fix tracker tests, jslint was not as happy as I was
Diffstat (limited to 'js')
-rw-r--r-- | js/piwik.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/js/piwik.js b/js/piwik.js index 84931dbbe5..e46ec90a6c 100644 --- a/js/piwik.js +++ b/js/piwik.js @@ -438,6 +438,8 @@ if (typeof JSON2 !== 'object') { /*members initialize */ /*global define */ /*members amd */ +/*global console:true */ +/*members error */ // asynchronous tracker (or proxy) if (typeof _paq !== 'object') { @@ -3133,17 +3135,18 @@ if (typeof Piwik !== 'object') { asyncTracker = new Tracker(); var applyFirst = {setTrackerUrl: 1, setAPIUrl: 1, setSiteId: 1}; + var methodName; // find the call to setTrackerUrl or setSiteid (if any) and call them first for (iterator = 0; iterator < _paq.length; iterator++) { - var methodName = _paq[iterator][0]; + methodName = _paq[iterator][0]; if (applyFirst[methodName]) { apply(_paq[iterator]); delete _paq[iterator]; if (applyFirst[methodName] > 1) { - if (typeof console !== 'undefined' && console && console.error) { + if (console !== undefined && console && console.error) { console.error('The method ' + methodName + ' is registered more than once in "_paq" variable. Only the last call has an effect. Please have a look at the multiple Piwik trackers documentation: http://developer.piwik.org/api-reference/tracking-javascript#multiple-piwik-trackers'); } } |