I am getting a warning (lint warning: undeclared identifier: e) when using Conditional catch clauses.
I got this "try" block from mozilla dev (http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Statements:try...catch).
Is it a bug ? Or I am doing something wrong...
cheers,
Eduardo
----------------------------------------------------
/*jsl:option explicit*/
function myroutine(){
var a = "hi";
}
function logMyErrors(){
var b = "hello";
}
try {
myroutine(); // may throw three exceptions
} catch (e if e instanceof TypeError) {
// statements to handle TypeError exceptions
} catch (e if e instanceof RangeError) {
// statements to handle RangeError exceptions
} catch (e if e instanceof EvalError) {
// statements to handle EvalError exceptions
} catch (e) {
// statements to handle any unspecified exceptions
logMyErrors(e); // pass exception object to error handler
}
--------------------------------------
cd /home/eduardo/u4js/
jsl -process /home/eduardo/u4js/bug-jsl.js
JavaScript Lint 0.3.0 (JavaScript-C 1.5 2004-09-24)
Developed by Matthias Miller (http://www.JavaScriptLint.com)
bug-jsl.js
/home/eduardo/u4js/bug-jsl.js(12): lint warning: undeclared identifier: e
/home/eduardo/u4js/bug-jsl.js(14): lint warning: undeclared identifier: e
/home/eduardo/u4js/bug-jsl.js(16): lint warning: undeclared identifier: e
0 error(s), 3 warning(s)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hi,
I am getting a warning (lint warning: undeclared identifier: e) when using Conditional catch clauses.
I got this "try" block from mozilla dev (http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Statements:try...catch).
Is it a bug ? Or I am doing something wrong...
cheers,
Eduardo
----------------------------------------------------
/*jsl:option explicit*/
function myroutine(){
var a = "hi";
}
function logMyErrors(){
var b = "hello";
}
try {
myroutine(); // may throw three exceptions
} catch (e if e instanceof TypeError) {
// statements to handle TypeError exceptions
} catch (e if e instanceof RangeError) {
// statements to handle RangeError exceptions
} catch (e if e instanceof EvalError) {
// statements to handle EvalError exceptions
} catch (e) {
// statements to handle any unspecified exceptions
logMyErrors(e); // pass exception object to error handler
}
--------------------------------------
cd /home/eduardo/u4js/
jsl -process /home/eduardo/u4js/bug-jsl.js
JavaScript Lint 0.3.0 (JavaScript-C 1.5 2004-09-24)
Developed by Matthias Miller (http://www.JavaScriptLint.com)
bug-jsl.js
/home/eduardo/u4js/bug-jsl.js(12): lint warning: undeclared identifier: e
/home/eduardo/u4js/bug-jsl.js(14): lint warning: undeclared identifier: e
/home/eduardo/u4js/bug-jsl.js(16): lint warning: undeclared identifier: e
0 error(s), 3 warning(s)