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);