admin管理员组文章数量:1277901
I have code like this (that cancel ajax calls):
if (requests.length) {
for (i=requests.length; i--;) {
var r = requests[i];
if (4 !== r.readyState) {
try {
r.abort();
} catch(e) {
self.error('error in aborting ajax');
}
}
}
requests = [];
// only resume if there are ajax calls
self.resume();
}
and jshint show error:
Value of 'e' may be overwritten in IE 8 and earlier.
in } catch(e) {
what that error mean?
I have code like this (that cancel ajax calls):
if (requests.length) {
for (i=requests.length; i--;) {
var r = requests[i];
if (4 !== r.readyState) {
try {
r.abort();
} catch(e) {
self.error('error in aborting ajax');
}
}
}
requests = [];
// only resume if there are ajax calls
self.resume();
}
and jshint show error:
Value of 'e' may be overwritten in IE 8 and earlier.
in } catch(e) {
what that error mean?
2 Answers
Reset to default 7The "Value of '{a}' may be overwritten in IE8 and earlier" error is thrown when JSHint or ESLint encounters a try...catch statement in which the catch identifier is the same as a variable or function identifer.
The error is only raised when the identifer in question is declared in the same scope as the catch.
In the following example we declare a variable, a, and then use a as the identifier in the catch block:
var a = 1;
try {
b();
} catch (a) {}
To resolve this issue simply ensure your exception parameter has an identifier unique to its scope:
var a = 1;
try {
b();
} catch (e) {}
http://linterrors./js/value-of-a-may-be-overwritten-in-ie8
I found the error it's event handler that have e as event. And this should throw an error https://github./jshint/jshint/issues/618
本文标签: javascriptValue of 39e39 may be overwritten in IE 8 and earlierStack Overflow
版权声明:本文标题:javascript - Value of 'e' may be overwritten in IE 8 and earlier - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741278953a2369894.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论