/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

console.doEval =
function con_eval(__s, __o)
{
    var __ex;
    var rv;
    
    try
    {
        if (__o)
        {
            with (__o)
            {
                rv = eval(__s);
            }
        }
        else
        {
            rv = eval(__s);
        }
    }
    catch (__ex)
    {
        dd ("doEval caught: " + __ex);
        
        if (__ex && typeof __ex == "object" && "fileName" in __ex &&
            __ex.fileName.search (/venkman-eval.js$/) != -1)
        {
            __ex.fileName = MSG_VAL_CONSOLE;
            __ex.lineNumber = console.evalCount;
        }
        ++console.evalCount;
        throw __ex;
    }

    ++console.evalCount;
    return rv;
}

