Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
eos: function() {
if (this.input) return;
var pos = this.position();
var prev = this.prev();
while (prev.type !== 'root' && !prev.visited) {
if (this.options.strict === true) {
throw new SyntaxError('invalid syntax:' + prev);
}
if (!util.hasOpenAndClose(prev)) {
define(prev.parent, 'escaped', true);
define(prev, 'escaped', true);
}
this.visit(prev, function(node) {
if (!util.hasOpenAndClose(node.parent)) {
define(node.parent, 'escaped', true);
define(node, 'escaped', true);
}
});
prev = prev.parent;
}
var node = pos(this.node(this.append || '', 'eos'));
if (typeof this.options.eos === 'function') {
this.visit(prev, function(node) {
if (!util.hasOpenAndClose(node.parent)) {
define(node.parent, 'escaped', true);
define(node, 'escaped', true);
}
});