UNPKG

js-slang

Version:

Javascript-based implementations of Source, written in Typescript

28 lines 646 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NoEval = void 0; const errors_1 = require("../../errors"); class NoEval extends errors_1.RuleError { explain() { return `eval is not allowed.`; } elaborate() { return this.explain(); } } exports.NoEval = NoEval; const noEval = { name: 'no-eval', checkers: { Identifier(node) { if (node.name === 'eval') { return [new NoEval(node)]; } else { return []; } } } }; exports.default = noEval; //# sourceMappingURL=noEval.js.map