denoland / deno_ast

Source text parsing, lexing, and AST related functionality for Deno
https://crates.io/crates/deno_ast
MIT License
146 stars 45 forks source link

fix: duplicate template index #166

Closed marvinhagemeister closed 10 months ago

marvinhagemeister commented 10 months ago

Found a case where we were generating duplicated template indexes. It was caused by us incrementing a value on the struct before visiting the nodes recursively and referencing the same property after recursing through the child AST nodes. The previous code didn't take into account that one of the visited children might increment the value when coming across a serializable subtree.