app.js at tip Вы: nobody
Вход

File Tests/Exceptions/app.js from the latest check-in


$engine JScript
$uname testExceptionsApp

var lib = addins.byUniqueName("testExceptionsLib");

lib.object.SetErrorHandler(ErrorHandler);

function ErrorHandler(except)
{
    throw except;
}

function macros()
{
    try
    {
        lib.object.throwErrorFunction();
    }
    catch (e)
    {
        Message("Gotcha: " + e.message);
    }
}

function macros()
{
    try
    {
        lib.invokeMacros("ThrowErrorMacros");
    }
    catch (e)
    {
        Message("Gotcha: " + e.text);
    }
}

function macrosWorkaround()
{
    try
    {
        lib.object.throwErrorFunctionWorkaround();
    }
    catch (e)
    {
        Message("Gotcha: " + e);
    }
}