Shut up tampermonkey about redefined variables

This commit is contained in:
Calvin Montgomery 2016-08-15 21:16:14 -07:00
parent ba9fbea1a1
commit 8d3b2e59df
1 changed files with 3 additions and 2 deletions

View File

@ -54,13 +54,14 @@
url: url, url: url,
onload: function (res) { onload: function (res) {
var data = {}; var data = {};
var error;
res.responseText.split('&').forEach(function (kv) { res.responseText.split('&').forEach(function (kv) {
var pair = kv.split('='); var pair = kv.split('=');
data[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]); data[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
}); });
if (data.status === 'fail') { if (data.status === 'fail') {
var error = new Error('Google Docs request failed: ' + error = new Error('Google Docs request failed: ' +
'metadata indicated status=fail'); 'metadata indicated status=fail');
error.response = res.responseText; error.response = res.responseText;
error.reason = 'RESPONSE_STATUS_FAIL'; error.reason = 'RESPONSE_STATUS_FAIL';
@ -68,7 +69,7 @@
} }
if (!data.fmt_stream_map) { if (!data.fmt_stream_map) {
var error = new Error('Google Docs request failed: ' + error = new Error('Google Docs request failed: ' +
'metadata lookup returned no valid links'); 'metadata lookup returned no valid links');
error.response = res.responseText; error.response = res.responseText;
error.reason = 'MISSING_LINKS'; error.reason = 'MISSING_LINKS';