Wolfram Heinz wrote:
[snip]
-->
catch(myerrorob ject)
alert(myerrorob ject.filename);
{
my_function('bl a: ',myerrorobject );
}
<---
I get the "myerrorobject. filename" in the alert-Box, but I get an
"undefined"-error, if I try to access myerrorobject.f ilename (or other
properties) in the function "my_functio n".
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(myerrorob ject) {
alert(myerrorob ject.filename);
}
{
my_function('bl a: ', 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.