TC 10.40 is trapping exceptions between units
This goes back to an older issue with TC where it was not sending exceptions between units. According to the documentation TC does not support cross-unit exception handling in JScript. There was at least one thread a while back where this was discussed.
I was trying to find a workaround but discovered that my test script in JScript actually is handling cross-unit exceptions. I have this:
[Unit1]
//USEUNIT Unit2
function t1() {
try
{
Unit2.testThis2();
} catch(e)
{
Log.Message(e.name+' - '+e.description);
}
}
[Unit2]
function testThis2()
{
1=2;
}
When I run Unit1.t1(), TC traps the exception thrown in Unit2.testThis2() and I get a nice message in the log with the name and description of the error. I do not recall TC doing this in a previous version.
When I change the line
Unit2.testThis2();
to
Unit2.testThis2.call();
TC just logs an error and stops running when testThis2() executes. It never makes it back to t1(). I also noticed some erratic crashes when I overrode Function.prototype.call in Unit2.
Is Smartbear working on a workaround for the lack of cross-unit exception handling with JScript? Is this a stable feature or do I just have a strange test system?