minor clean-ups (#5604)

This commit is contained in:
Alex Lam S.L
2022-08-06 03:45:44 +01:00
committed by GitHub
parent a9d9af53e9
commit 387c69b194
4 changed files with 65 additions and 130 deletions

View File

@@ -128,12 +128,7 @@ var AST_Node = DEFNODE("Node", "start end", {
var marker = {};
this.walk(new TreeWalker(function(node) {
if (node.validate_visited === marker) {
throw new Error(string_template("cannot reuse {type} from [{file}:{line},{col}]", {
type: "AST_" + node.TYPE,
file: node.start.file,
line: node.start.line,
col: node.start.col,
}));
throw new Error(string_template("cannot reuse AST_{TYPE} from [{start}]", node));
}
node.validate_visited = marker;
}));