Artifact
302194101722beeef25a2b31bf59f8e812982983:
- File
Tests/Exceptions/lib.js
— part of check-in
[7c39f7a8f1]
at
2011-11-06 20:34:36
on branch jsunit-port
— Пример тестовых скриптов, демонстрирующих проблему с перехватом исключений и ее обход
(user:
kuntashov
size: 669)
[more...]
$engine JScript
$uname testExceptionsLib
var ErrorHandler = null;
function SetErrorHandler(errorHandler)
{
ErrorHandler = errorHandler;
}
function throwError(e)
{
if (ErrorHandler)
{
ErrorHandler.call(null, e);
//ErrorHandler(e);
return e;
}
throw e;
}
function throwErrorFunction()
{
throw "Excepiton from testExceptionsLib.throwErrorFunction()";
}
function macrosThrowErrorMacros()
{
throw "Excepiton from testExceptionsLib.throwErrorMacros()";
}
function throwErrorFunctionWorkaround()
{
throwError("Excepiton from testExceptionsLib.throwErrorFunction()");
}