INNER CODE UNIT · JavaScript

testEvaluator

gnh1201/welsonjs · app.js:433

function testEvaluator(evaluator) {
    return (ALLOW_UNSAFE_EVAL && evaluator === eval);
}

/**
 * @param {string} filename The file name.
 * @param {boolean} ignoreUnsafeEval Whether to ignore unsafe eval checks.
 */
function evaluateFile(filename, ignoreUnsafeEval) {
    try {
        var evaluate = eval;
        if (!testEvaluator(evaluate) && !ignoreUnsafeEval) {
            throw new Error("Unsafe eval is not allowed. Please set ALLOW_UNSAFE_EVAL to true.");
        }
        return evaluate(require._load(filename));
    } catch (e) {
        console.error(e.message);
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…