From 6c390f5f682b3afb77946f7af7fe9a5e101b2a1c Mon Sep 17 00:00:00 2001 From: kzc Date: Mon, 6 Nov 2017 11:17:41 -0500 Subject: [PATCH] decrease max clone depth --- lib/ast.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ast.js b/lib/ast.js index 99415446..8382495c 100644 --- a/lib/ast.js +++ b/lib/ast.js @@ -93,8 +93,9 @@ var AST_Token = DEFNODE("Token", "type value line col pos endline endcol endpos var AST_Node = DEFNODE("Node", "start end", { _clone: function(deep, depth) { if (typeof depth == "undefined") depth = 0; - if (depth++ > 1000) { - throw new Error("clone depth exceeded (" + this.start.line + ", " + this.start.col + ")"); + if (depth++ > 500) { + throw new Error("maximum clone depth exceeded (" + + this.start.file + ":" + this.start.line + ":" + this.start.col + ")"); } if (deep) { var self = this.clone(false, depth);