Commit 4aa32a41 authored by Romain Courteaud's avatar Romain Courteaud

JSLint: do not redefine the same variable

parent 22d754ee
...@@ -140,8 +140,9 @@ ...@@ -140,8 +140,9 @@
that._key, buf); that._key, buf);
}) })
.push(function (coded) { .push(function (coded) {
var blob = new Blob([initializaton_vector, coded], {type: MIME_TYPE}); var final_blob = new Blob([initializaton_vector, coded],
return that._sub_storage.putAttachment(id, name, blob); {type: MIME_TYPE});
return that._sub_storage.putAttachment(id, name, final_blob);
}); });
}; };
......
...@@ -185,7 +185,7 @@ ...@@ -185,7 +185,7 @@
var i, var i,
attachment = {}, attachment = {},
id, new_id,
attachment_list = new DOMParser().parseFromString( attachment_list = new DOMParser().parseFromString(
response.target.responseText, response.target.responseText,
"text/xml" "text/xml"
...@@ -196,11 +196,11 @@ ...@@ -196,11 +196,11 @@
// exclude parent folder and browse // exclude parent folder and browse
for (i = 1; i < attachment_list.length; i += 1) { for (i = 1; i < attachment_list.length; i += 1) {
// XXX Only get files for now // XXX Only get files for now
id = attachment_list[i].querySelector("D\\:href, href"). new_id = attachment_list[i].querySelector("D\\:href, href").
textContent.split('/').slice(-1)[0]; textContent.split('/').slice(-1)[0];
// XXX Ugly // XXX Ugly
if ((id !== undefined) && (id !== "")) { if ((new_id !== undefined) && (new_id !== "")) {
attachment[id] = {}; attachment[new_id] = {};
} }
} }
return attachment; return attachment;
......
...@@ -292,9 +292,9 @@ ...@@ -292,9 +292,9 @@
return jIO.util.readBlobAsText(error.target.response); return jIO.util.readBlobAsText(error.target.response);
}) })
.push(function (evt) { .push(function (evt) {
var err_content = JSON.parse(evt.target.result); var err_content2 = JSON.parse(evt.target.result);
if ((err_content.error['.tag'] === 'path') && if ((err_content2.error['.tag'] === 'path') &&
(err_content.error.path['.tag'] === 'not_found')) { (err_content2.error.path['.tag'] === 'not_found')) {
throw new jIO.util.jIOError("Cannot find attachment: " + throw new jIO.util.jIOError("Cannot find attachment: " +
id + "/, " + name, 404); id + "/, " + name, 404);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment