Lets not use try, catch
This commit is contained in:
parent
844d1f8921
commit
faa8ee63b0
@ -5436,19 +5436,9 @@
|
|||||||
return QR.nodes.fileInput.click();
|
return QR.nodes.fileInput.click();
|
||||||
},
|
},
|
||||||
fileInput: function(files) {
|
fileInput: function(files) {
|
||||||
var check, err, file, length, max, post, _i, _len;
|
var file, length, max, post, _i, _len;
|
||||||
|
|
||||||
try {
|
if (this instanceof Element) {
|
||||||
if (files instanceof Event) {
|
|
||||||
check = true;
|
|
||||||
}
|
|
||||||
} catch (_error) {
|
|
||||||
err = _error;
|
|
||||||
if (this instanceof Element) {
|
|
||||||
check = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (check) {
|
|
||||||
files = __slice.call(this.files);
|
files = __slice.call(this.files);
|
||||||
QR.nodes.fileInput.value = null;
|
QR.nodes.fileInput.value = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5446,19 +5446,9 @@
|
|||||||
return QR.nodes.fileInput.click();
|
return QR.nodes.fileInput.click();
|
||||||
},
|
},
|
||||||
fileInput: function(files) {
|
fileInput: function(files) {
|
||||||
var check, err, file, length, max, post, _i, _len;
|
var file, length, max, post, _i, _len;
|
||||||
|
|
||||||
try {
|
if (this instanceof Element) {
|
||||||
if (files instanceof Event) {
|
|
||||||
check = true;
|
|
||||||
}
|
|
||||||
} catch (_error) {
|
|
||||||
err = _error;
|
|
||||||
if (this instanceof Element) {
|
|
||||||
check = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (check) {
|
|
||||||
files = __slice.call(this.files);
|
files = __slice.call(this.files);
|
||||||
QR.nodes.fileInput.value = null;
|
QR.nodes.fileInput.value = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -443,13 +443,7 @@ QR =
|
|||||||
QR.nodes.fileInput.click()
|
QR.nodes.fileInput.click()
|
||||||
|
|
||||||
fileInput: (files) ->
|
fileInput: (files) ->
|
||||||
try
|
if @ instanceof Element # file input, revert to "files instanceof Event" after a Pale Moon update
|
||||||
if files instanceof Event # file input
|
|
||||||
check = true
|
|
||||||
catch err
|
|
||||||
if @ instanceof Element # file input
|
|
||||||
check = true
|
|
||||||
if check
|
|
||||||
files = [@files...]
|
files = [@files...]
|
||||||
QR.nodes.fileInput.value = null # Don't hold the files from being modified on windows
|
QR.nodes.fileInput.value = null # Don't hold the files from being modified on windows
|
||||||
{length} = files
|
{length} = files
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user