ExternalInterface.call(...) functions, what happens to their JS exceptions?

If I have a Javascript function that I create ON the flash object in a webpage, like this:

document.all[“myflashobj”].TestFunction = function() {
alert(“inside TestFunction”);
throw new Error(“from TestFunction”);
}

And also in the webpage, I have this:

window.onerror = function(err) { alert(err.message); }

And then inside of my Flash, I call:

ExternalInterface.call(“document.all[‘myflashobj’].TestFunction”);

the “inside TestFunction” message is alert’d, but the Javascript exception that is raised in my Test function is not sent either to the flash (because I don’t have ExternalInterface.marshallExceptions set to true), nor is it propogated anywhere out into the Javascript, to be caught eventually by the window.onerror command.

However, if I have this function:

function TestFunction2() {
alert(“inside TestFunction2”);
throw new Error(“from TestFunction2”);
}

and I call

ExternalInterface.call(“TestFunction2”);

then in fact the alert happens AND the javascript error/exception makes its way back up to the window.onerror command, so I get “from TestFunction2” alert’d as well.

So, what I’m guessing is that the JS function that I dynamically create ON the flash object is somehow smoothered by some sort of try/catch which is catching that error, where as the function dynamically defined NOT on the flash object isn’t? But even me typing this statement really makes no sense to me.

Anyone can help me understand what’s going on?