Is there a method to compare two javascript files for equivalent functionality? E.g.:
const foo = 1
console.log(foo)
and
const bar = 1
console.log(bar)
would be considered functionally equivalent.
I don't need to determine equivalence in all situations. Handling basic name changes is enough for my current use case (and probably solves most if not all future use cases).
My only thought is to maybe use a minifier with predictable naming obfuscation. Like, the first name encountered is always transliterated to v1, the 2nd to v2, etc. I realize I could create instrument a parser or something and could do that eventually, but I was hoping to find an existing solution.