Lets not use try, catch

This commit is contained in:
Jordan Bates 2013-08-15 20:44:06 -07:00
parent 844d1f8921
commit faa8ee63b0
3 changed files with 5 additions and 31 deletions

View File

@ -5436,19 +5436,9 @@
return QR.nodes.fileInput.click();
},
fileInput: function(files) {
var check, err, file, length, max, post, _i, _len;
var file, length, max, post, _i, _len;
try {
if (files instanceof Event) {
check = true;
}
} catch (_error) {
err = _error;
if (this instanceof Element) {
check = true;
}
}
if (check) {
if (this instanceof Element) {
files = __slice.call(this.files);
QR.nodes.fileInput.value = null;
}

View File

@ -5446,19 +5446,9 @@
return QR.nodes.fileInput.click();
},
fileInput: function(files) {
var check, err, file, length, max, post, _i, _len;
var file, length, max, post, _i, _len;
try {
if (files instanceof Event) {
check = true;
}
} catch (_error) {
err = _error;
if (this instanceof Element) {
check = true;
}
}
if (check) {
if (this instanceof Element) {
files = __slice.call(this.files);
QR.nodes.fileInput.value = null;
}

View File

@ -443,13 +443,7 @@ QR =
QR.nodes.fileInput.click()
fileInput: (files) ->
try
if files instanceof Event # file input
check = true
catch err
if @ instanceof Element # file input
check = true
if check
if @ instanceof Element # file input, revert to "files instanceof Event" after a Pale Moon update
files = [@files...]
QR.nodes.fileInput.value = null # Don't hold the files from being modified on windows
{length} = files