Wolfram Heinz wrote:
[snip]
-->
catch(myerrorobject)
alert(myerrorobject.filename);
{
my_function('bla: ',myerrorobject);
}
<---
I get the "myerrorobject.filename" in the alert-Box, but I get an
"undefined"-error, if I try to access myerrorobject.filename (or other
properties) in the function "my_function".
Why?
If that's your literal code, it's because myerrorobject doesn't exist
when the function call occurs. The code will be parsed as:
catch(myerrorobject) {
alert(myerrorobject.filename);
}
{
my_function('bla: ', myerrorobject);
}
Notice that there are two blocks. The catch identifier will only exist
in the first.
To be honest, I'm surprised that would work at all. A catch clause
must be followed by a block unlike if, for example, which may be
followed by either a statement or a block.
If what you posted is a typo, I think you'll have to post a more
complete example.
Mike
--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.